diff options
author | Paul Barton <28630076+paulbarton90@users.noreply.github.com> | 2021-01-02 23:47:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 18:47:47 -0500 |
commit | 7576e37a65729363370d6672ff6e69e87b68ac5f (patch) | |
tree | c2e885826e6f744b88949c9451d6a206ff48abcd /modules/structs/repo.go | |
parent | 3abea9e9eb8cbe42d1ec0afa70b4941d4066130f (diff) | |
download | gitea-7576e37a65729363370d6672ff6e69e87b68ac5f.tar.gz gitea-7576e37a65729363370d6672ff6e69e87b68ac5f.zip |
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>
Diffstat (limited to 'modules/structs/repo.go')
-rw-r--r-- | modules/structs/repo.go | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go index c12f8e1c18..309273d2fa 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -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 |