mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add MirrorInterval to the API (#14163)
* Added MirrorInterval to the API * Remove MirrorInterval from CreateRepository * Removed Duplicate UpdateMirror Function * Updated Error Logging * Update Log Message for is not Mirror Co-authored-by: 6543 <6543@obermui.de> * Delete Debug Statement that snuck in Co-authored-by: zeripath <art27@cantab.net> * Add Check for If Interval is too small * Output to API Call * Add Error Object when time is Less than Min Interval * Frequency Error Message Co-authored-by: zeripath <art27@cantab.net> * Allow Zero Mirror Interval Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -91,6 +91,7 @@ type Repository struct {
 | 
			
		||||
	AllowSquash               bool             `json:"allow_squash_merge"`
 | 
			
		||||
	AvatarURL                 string           `json:"avatar_url"`
 | 
			
		||||
	Internal                  bool             `json:"internal"`
 | 
			
		||||
	MirrorInterval            string           `json:"mirror_interval"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CreateRepoOption options when creating repository
 | 
			
		||||
@@ -168,6 +169,8 @@ type EditRepoOption struct {
 | 
			
		||||
	AllowSquash *bool `json:"allow_squash_merge,omitempty"`
 | 
			
		||||
	// set to `true` to archive this repository.
 | 
			
		||||
	Archived *bool `json:"archived,omitempty"`
 | 
			
		||||
	// set to a string like `8h30m0s` to set the mirror interval time
 | 
			
		||||
	MirrorInterval *string `json:"mirror_interval,omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CreateBranchRepoOption options when creating a branch in a repository
 | 
			
		||||
@@ -249,15 +252,16 @@ type MigrateRepoOptions struct {
 | 
			
		||||
	AuthPassword string `json:"auth_password"`
 | 
			
		||||
	AuthToken    string `json:"auth_token"`
 | 
			
		||||
 | 
			
		||||
	Mirror       bool   `json:"mirror"`
 | 
			
		||||
	Private      bool   `json:"private"`
 | 
			
		||||
	Description  string `json:"description" binding:"MaxSize(255)"`
 | 
			
		||||
	Wiki         bool   `json:"wiki"`
 | 
			
		||||
	Milestones   bool   `json:"milestones"`
 | 
			
		||||
	Labels       bool   `json:"labels"`
 | 
			
		||||
	Issues       bool   `json:"issues"`
 | 
			
		||||
	PullRequests bool   `json:"pull_requests"`
 | 
			
		||||
	Releases     bool   `json:"releases"`
 | 
			
		||||
	Mirror         bool   `json:"mirror"`
 | 
			
		||||
	Private        bool   `json:"private"`
 | 
			
		||||
	Description    string `json:"description" binding:"MaxSize(255)"`
 | 
			
		||||
	Wiki           bool   `json:"wiki"`
 | 
			
		||||
	Milestones     bool   `json:"milestones"`
 | 
			
		||||
	Labels         bool   `json:"labels"`
 | 
			
		||||
	Issues         bool   `json:"issues"`
 | 
			
		||||
	PullRequests   bool   `json:"pull_requests"`
 | 
			
		||||
	Releases       bool   `json:"releases"`
 | 
			
		||||
	MirrorInterval string `json:"mirror_interval"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TokenAuth represents whether a service type supports token-based auth
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user