Commit 321eba65 authored by Sander van Harmelen's avatar Sander van Harmelen

Fix style

parent 02ba1eae
...@@ -29,8 +29,8 @@ to add new and/or missing endpoints. Currently the following services are suppor ...@@ -29,8 +29,8 @@ to add new and/or missing endpoints. Currently the following services are suppor
- [x] Branches - [x] Branches
- [x] Broadcast Messages - [x] Broadcast Messages
- [x] Commits - [x] Commits
- [x] Custom Attributes
- [x] Container Registry - [x] Container Registry
- [x] Custom Attributes
- [x] Deploy Keys - [x] Deploy Keys
- [x] Deployments - [x] Deployments
- [x] Environments - [x] Environments
......
...@@ -294,6 +294,7 @@ type Client struct { ...@@ -294,6 +294,7 @@ type Client struct {
BuildVariables *BuildVariablesService BuildVariables *BuildVariablesService
CIYMLTemplate *CIYMLTemplatesService CIYMLTemplate *CIYMLTemplatesService
Commits *CommitsService Commits *CommitsService
ContainerRegistry *ContainerRegistryService
CustomAttribute *CustomAttributesService CustomAttribute *CustomAttributesService
DeployKeys *DeployKeysService DeployKeys *DeployKeysService
Deployments *DeploymentsService Deployments *DeploymentsService
...@@ -333,7 +334,6 @@ type Client struct { ...@@ -333,7 +334,6 @@ type Client struct {
Projects *ProjectsService Projects *ProjectsService
ProtectedBranches *ProtectedBranchesService ProtectedBranches *ProtectedBranchesService
ProtectedTags *ProtectedTagsService ProtectedTags *ProtectedTagsService
ContainerRegistry *ContainerRegistryService
Repositories *RepositoriesService Repositories *RepositoriesService
RepositoryFiles *RepositoryFilesService RepositoryFiles *RepositoryFilesService
Runners *RunnersService Runners *RunnersService
...@@ -438,6 +438,7 @@ func newClient(httpClient *http.Client) *Client { ...@@ -438,6 +438,7 @@ func newClient(httpClient *http.Client) *Client {
c.BuildVariables = &BuildVariablesService{client: c} c.BuildVariables = &BuildVariablesService{client: c}
c.CIYMLTemplate = &CIYMLTemplatesService{client: c} c.CIYMLTemplate = &CIYMLTemplatesService{client: c}
c.Commits = &CommitsService{client: c} c.Commits = &CommitsService{client: c}
c.ContainerRegistry = &ContainerRegistryService{client: c}
c.CustomAttribute = &CustomAttributesService{client: c} c.CustomAttribute = &CustomAttributesService{client: c}
c.DeployKeys = &DeployKeysService{client: c} c.DeployKeys = &DeployKeysService{client: c}
c.Deployments = &DeploymentsService{client: c} c.Deployments = &DeploymentsService{client: c}
...@@ -477,7 +478,6 @@ func newClient(httpClient *http.Client) *Client { ...@@ -477,7 +478,6 @@ func newClient(httpClient *http.Client) *Client {
c.Projects = &ProjectsService{client: c} c.Projects = &ProjectsService{client: c}
c.ProtectedBranches = &ProtectedBranchesService{client: c} c.ProtectedBranches = &ProtectedBranchesService{client: c}
c.ProtectedTags = &ProtectedTagsService{client: c} c.ProtectedTags = &ProtectedTagsService{client: c}
c.ContainerRegistry = &ContainerRegistryService{client: c}
c.Repositories = &RepositoriesService{client: c} c.Repositories = &RepositoriesService{client: c}
c.RepositoryFiles = &RepositoryFilesService{client: c} c.RepositoryFiles = &RepositoryFilesService{client: c}
c.Runners = &RunnersService{client: c} c.Runners = &RunnersService{client: c}
......
...@@ -39,7 +39,7 @@ type RegistryRepositoryTag struct { ...@@ -39,7 +39,7 @@ type RegistryRepositoryTag struct {
Revision string `json:"revision"` Revision string `json:"revision"`
ShortRevision string `json:"short_revision"` ShortRevision string `json:"short_revision"`
Digest string `json:"digest"` Digest string `json:"digest"`
CreatedAt *time.Time `json:"created_at,omitempty"` CreatedAt *time.Time `json:"created_at"`
TotalSize int `json:"total_size"` TotalSize int `json:"total_size"`
} }
...@@ -47,13 +47,14 @@ func (s RegistryRepositoryTag) String() string { ...@@ -47,13 +47,14 @@ func (s RegistryRepositoryTag) String() string {
return Stringify(s) return Stringify(s)
} }
// ListRegistryRepositoriesOptions represents the available ListRegistryRepositories() options. // ListRegistryRepositoriesOptions represents the available
// ListRegistryRepositories() options.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories // https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories
type ListRegistryRepositoriesOptions ListOptions type ListRegistryRepositoriesOptions ListOptions
// ListRegistryRepositories gets a list of registry repositories in a projecty // ListRegistryRepositories gets a list of registry repositories in a project.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories // https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories
...@@ -74,6 +75,7 @@ func (s *ContainerRegistryService) ListRegistryRepositories(pid interface{}, opt ...@@ -74,6 +75,7 @@ func (s *ContainerRegistryService) ListRegistryRepositories(pid interface{}, opt
if err != nil { if err != nil {
return nil, resp, err return nil, resp, err
} }
return repos, resp, err return repos, resp, err
} }
...@@ -86,13 +88,13 @@ func (s *ContainerRegistryService) DeleteRegistryRepository(pid interface{}, rep ...@@ -86,13 +88,13 @@ func (s *ContainerRegistryService) DeleteRegistryRepository(pid interface{}, rep
if err != nil { if err != nil {
return nil, err return nil, err
} }
u := fmt.Sprintf("projects/%s/registry/repositories/%d", url.QueryEscape(project), repository) u := fmt.Sprintf("projects/%s/registry/repositories/%d", url.QueryEscape(project), repository)
req, err := s.client.NewRequest("DELETE", u, nil, options) req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return s.client.Do(req, nil) return s.client.Do(req, nil)
} }
...@@ -112,7 +114,6 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid interface{}, r ...@@ -112,7 +114,6 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid interface{}, r
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags", u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags",
url.QueryEscape(project), url.QueryEscape(project),
repository, repository,
...@@ -123,12 +124,13 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid interface{}, r ...@@ -123,12 +124,13 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid interface{}, r
return nil, nil, err return nil, nil, err
} }
var repos []*RegistryRepositoryTag var tags []*RegistryRepositoryTag
resp, err := s.client.Do(req, &repos) resp, err := s.client.Do(req, &tags)
if err != nil { if err != nil {
return nil, resp, err return nil, resp, err
} }
return repos, resp, err
return tags, resp, err
} }
// GetRegistryRepositoryTagDetail get details of a registry repository tag // GetRegistryRepositoryTagDetail get details of a registry repository tag
...@@ -140,7 +142,6 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid interface{ ...@@ -140,7 +142,6 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid interface{
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags/%s", u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags/%s",
url.QueryEscape(project), url.QueryEscape(project),
repository, repository,
...@@ -152,12 +153,13 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid interface{ ...@@ -152,12 +153,13 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid interface{
return nil, nil, err return nil, nil, err
} }
td := new(RegistryRepositoryTag) tag := new(RegistryRepositoryTag)
resp, err := s.client.Do(req, &td) resp, err := s.client.Do(req, &tag)
if err != nil { if err != nil {
return nil, resp, err return nil, resp, err
} }
return td, resp, err
return tag, resp, err
} }
// DeleteRegistryRepositoryTag deletes a registry repository tag. // DeleteRegistryRepositoryTag deletes a registry repository tag.
...@@ -169,7 +171,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{}, ...@@ -169,7 +171,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{},
if err != nil { if err != nil {
return nil, err return nil, err
} }
u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags/%s", u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags/%s",
url.QueryEscape(project), url.QueryEscape(project),
repository, repository,
...@@ -180,6 +181,7 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{}, ...@@ -180,6 +181,7 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{},
if err != nil { if err != nil {
return nil, err return nil, err
} }
return s.client.Do(req, nil) return s.client.Do(req, nil)
} }
...@@ -194,7 +196,8 @@ type DeleteRegistryRepositoryTagsOptions struct { ...@@ -194,7 +196,8 @@ type DeleteRegistryRepositoryTagsOptions struct {
OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"` OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"`
} }
// DeleteRegistryRepositoryTags deletes repository tags in bulk based on given criteria. // DeleteRegistryRepositoryTags deletes repository tags in bulk based on
// given criteria.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk // https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk
...@@ -203,7 +206,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid interface{}, ...@@ -203,7 +206,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid interface{},
if err != nil { if err != nil {
return nil, err return nil, err
} }
u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags", u := fmt.Sprintf("projects/%s/registry/repositories/%d/tags",
url.QueryEscape(project), url.QueryEscape(project),
repository, repository,
...@@ -213,5 +215,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid interface{}, ...@@ -213,5 +215,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid interface{},
if err != nil { if err != nil {
return nil, err return nil, err
} }
return s.client.Do(req, nil) return s.client.Do(req, nil)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment