Add tag protection manage via rest API. --------- Co-authored-by: Alexander Kogay <kogay.a@citilink.ru> Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit d4e4226c3cbfa62a6adf15f4466747468eb208c7) Conflicts: modules/structs/repo_tag.go trivial context conflict templates/swagger/v1_json.tmpl fixed with make generate-swagger
This commit is contained in:
parent
7fa7ec0891
commit
ff43d02803
8 changed files with 778 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
|||
|
||||
package structs
|
||||
|
||||
import "time"
|
||||
|
||||
// Tag represents a repository tag
|
||||
type Tag struct {
|
||||
Name string `json:"name"`
|
||||
|
@ -46,3 +48,29 @@ type TagArchiveDownloadCount struct {
|
|||
Zip int64 `json:"zip"`
|
||||
TarGz int64 `json:"tar_gz"`
|
||||
}
|
||||
|
||||
// TagProtection represents a tag protection
|
||||
type TagProtection struct {
|
||||
ID int64 `json:"id"`
|
||||
NamePattern string `json:"name_pattern"`
|
||||
WhitelistUsernames []string `json:"whitelist_usernames"`
|
||||
WhitelistTeams []string `json:"whitelist_teams"`
|
||||
// swagger:strfmt date-time
|
||||
Created time.Time `json:"created_at"`
|
||||
// swagger:strfmt date-time
|
||||
Updated time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// CreateTagProtectionOption options for creating a tag protection
|
||||
type CreateTagProtectionOption struct {
|
||||
NamePattern string `json:"name_pattern"`
|
||||
WhitelistUsernames []string `json:"whitelist_usernames"`
|
||||
WhitelistTeams []string `json:"whitelist_teams"`
|
||||
}
|
||||
|
||||
// EditTagProtectionOption options for editing a tag protection
|
||||
type EditTagProtectionOption struct {
|
||||
NamePattern *string `json:"name_pattern"`
|
||||
WhitelistUsernames []string `json:"whitelist_usernames"`
|
||||
WhitelistTeams []string `json:"whitelist_teams"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue