Documentation ¶
Index ¶
- func GetPoliciesByRepository(repository string) ([]*models.RepPolicy, error)
- func TriggerReplication(policyID int64, repository string, tags []string, operation string) error
- func TriggerReplicationByRepository(repository string, tags []string, operation string)
- type BaseAPI
- func (b *BaseAPI) DecodeJSONReq(v interface{})
- func (b *BaseAPI) DecodeJSONReqAndValidate(v interface{})
- func (b *BaseAPI) GetIDFromURL() int64
- func (b *BaseAPI) Redirect(statusCode int, resouceID string)
- func (b *BaseAPI) Render() error
- func (b *BaseAPI) RenderError(code int, text string)
- func (b *BaseAPI) Validate(v interface{})
- func (b *BaseAPI) ValidateUser() int
- type LogAPI
- type ProjectAPI
- type ProjectMemberAPI
- type RepJobAPI
- type RepPolicyAPI
- type RepositoryAPI
- type SearchAPI
- type StatisticAPI
- type TargetAPI
- type UserAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPoliciesByRepository ¶
GetPoliciesByRepository returns policies according the repository
func TriggerReplication ¶
TriggerReplication triggers the replication according to the policy
func TriggerReplicationByRepository ¶
TriggerReplicationByRepository triggers the replication according to the repository
Types ¶
type BaseAPI ¶
type BaseAPI struct {
beego.Controller
}
BaseAPI wraps common methods for controllers to host API
func (*BaseAPI) DecodeJSONReq ¶
func (b *BaseAPI) DecodeJSONReq(v interface{})
DecodeJSONReq decodes a json request
func (*BaseAPI) DecodeJSONReqAndValidate ¶
func (b *BaseAPI) DecodeJSONReqAndValidate(v interface{})
DecodeJSONReqAndValidate does both decoding and validation
func (*BaseAPI) GetIDFromURL ¶
GetIDFromURL checks the ID in request URL
func (*BaseAPI) RenderError ¶
RenderError provides shortcut to render http error
func (*BaseAPI) Validate ¶
func (b *BaseAPI) Validate(v interface{})
Validate validates v if it implements interface validation.ValidFormer
func (*BaseAPI) ValidateUser ¶
ValidateUser checks if the request triggered by a valid user
type LogAPI ¶
type LogAPI struct { BaseAPI // contains filtered or unexported fields }
LogAPI handles request api/logs
type ProjectAPI ¶
type ProjectAPI struct { BaseAPI // contains filtered or unexported fields }
ProjectAPI handles request to /api/projects/{} /api/projects/{}/logs
func (*ProjectAPI) FilterAccessLog ¶
func (p *ProjectAPI) FilterAccessLog()
FilterAccessLog handles GET to /api/projects/{}/logs
func (*ProjectAPI) ToggleProjectPublic ¶
func (p *ProjectAPI) ToggleProjectPublic()
ToggleProjectPublic ...
type ProjectMemberAPI ¶
type ProjectMemberAPI struct { BaseAPI // contains filtered or unexported fields }
ProjectMemberAPI handles request to /api/projects/{}/members/{}
func (*ProjectMemberAPI) Prepare ¶
func (pma *ProjectMemberAPI) Prepare()
Prepare validates the URL and parms
type RepJobAPI ¶
type RepJobAPI struct { BaseAPI // contains filtered or unexported fields }
RepJobAPI handles request to /api/replicationJobs /api/replicationJobs/:id/log
type RepPolicyAPI ¶
type RepPolicyAPI struct {
BaseAPI
}
RepPolicyAPI handles /api/replicationPolicies /api/replicationPolicies/:id/enablement
func (*RepPolicyAPI) List ¶
func (pa *RepPolicyAPI) List()
List filters policies by name and project_id, if name and project_id are nil, List returns all policies
func (*RepPolicyAPI) Post ¶
func (pa *RepPolicyAPI) Post()
Post creates a policy, and if it is enbled, the replication will be triggered right now.
func (*RepPolicyAPI) Prepare ¶
func (pa *RepPolicyAPI) Prepare()
Prepare validates whether the user has system admin role
func (*RepPolicyAPI) Put ¶
func (pa *RepPolicyAPI) Put()
Put modifies name, description, target and enablement of policy
func (*RepPolicyAPI) UpdateEnablement ¶
func (pa *RepPolicyAPI) UpdateEnablement()
UpdateEnablement changes the enablement of the policy
type RepositoryAPI ¶
type RepositoryAPI struct {
BaseAPI
}
RepositoryAPI handles request to /api/repositories /api/repositories/tags /api/repositories/manifests, the parm has to be put in the query string as the web framework can not parse the URL if it contains veriadic sectors.
func (*RepositoryAPI) GetManifests ¶
func (ra *RepositoryAPI) GetManifests()
GetManifests handles GET /api/repositories/manifests
func (*RepositoryAPI) GetTags ¶
func (ra *RepositoryAPI) GetTags()
GetTags handles GET /api/repositories/tags
func (*RepositoryAPI) GetTopRepos ¶
func (ra *RepositoryAPI) GetTopRepos()
GetTopRepos handles request GET /api/repositories/top
type StatisticAPI ¶
type StatisticAPI struct { BaseAPI // contains filtered or unexported fields }
StatisticAPI handles request to /api/statistics/
func (*StatisticAPI) Prepare ¶
func (s *StatisticAPI) Prepare()
Prepare validates the URL and the user
type TargetAPI ¶
type TargetAPI struct {
BaseAPI
}
TargetAPI handles request to /api/targets/ping /api/targets/{}
type UserAPI ¶
type UserAPI struct { BaseAPI SelfRegistration bool IsAdmin bool AuthMode string // contains filtered or unexported fields }
UserAPI handles request to /api/users/{}
func (*UserAPI) ChangePassword ¶
func (ua *UserAPI) ChangePassword()
ChangePassword handles PUT to /api/users/{}/password
func (*UserAPI) ToggleUserAdminRole ¶
func (ua *UserAPI) ToggleUserAdminRole()
ToggleUserAdminRole handles PUT api/users/{}/sysadmin