Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
321eba65
Commit
321eba65
authored
Mar 06, 2019
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix style
parent
02ba1eae
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
README.md
README.md
+1
-1
gitlab.go
gitlab.go
+2
-2
registry.go
registry.go
+18
-15
No files found.
README.md
View file @
321eba65
...
...
@@ -29,8 +29,8 @@ to add new and/or missing endpoints. Currently the following services are suppor
-
[
x
]
Branches
-
[
x
]
Broadcast Messages
-
[
x
]
Commits
-
[
x
]
Custom Attributes
-
[
x
]
Container Registry
-
[
x
]
Custom Attributes
-
[
x
]
Deploy Keys
-
[
x
]
Deployments
-
[
x
]
Environments
...
...
gitlab.go
View file @
321eba65
...
...
@@ -294,6 +294,7 @@ type Client struct {
BuildVariables
*
BuildVariablesService
CIYMLTemplate
*
CIYMLTemplatesService
Commits
*
CommitsService
ContainerRegistry
*
ContainerRegistryService
CustomAttribute
*
CustomAttributesService
DeployKeys
*
DeployKeysService
Deployments
*
DeploymentsService
...
...
@@ -333,7 +334,6 @@ type Client struct {
Projects
*
ProjectsService
ProtectedBranches
*
ProtectedBranchesService
ProtectedTags
*
ProtectedTagsService
ContainerRegistry
*
ContainerRegistryService
Repositories
*
RepositoriesService
RepositoryFiles
*
RepositoryFilesService
Runners
*
RunnersService
...
...
@@ -438,6 +438,7 @@ func newClient(httpClient *http.Client) *Client {
c
.
BuildVariables
=
&
BuildVariablesService
{
client
:
c
}
c
.
CIYMLTemplate
=
&
CIYMLTemplatesService
{
client
:
c
}
c
.
Commits
=
&
CommitsService
{
client
:
c
}
c
.
ContainerRegistry
=
&
ContainerRegistryService
{
client
:
c
}
c
.
CustomAttribute
=
&
CustomAttributesService
{
client
:
c
}
c
.
DeployKeys
=
&
DeployKeysService
{
client
:
c
}
c
.
Deployments
=
&
DeploymentsService
{
client
:
c
}
...
...
@@ -477,7 +478,6 @@ func newClient(httpClient *http.Client) *Client {
c
.
Projects
=
&
ProjectsService
{
client
:
c
}
c
.
ProtectedBranches
=
&
ProtectedBranchesService
{
client
:
c
}
c
.
ProtectedTags
=
&
ProtectedTagsService
{
client
:
c
}
c
.
ContainerRegistry
=
&
ContainerRegistryService
{
client
:
c
}
c
.
Repositories
=
&
RepositoriesService
{
client
:
c
}
c
.
RepositoryFiles
=
&
RepositoryFilesService
{
client
:
c
}
c
.
Runners
=
&
RunnersService
{
client
:
c
}
...
...
registry.go
View file @
321eba65
...
...
@@ -39,7 +39,7 @@ type RegistryRepositoryTag struct {
Revision
string
`json:"revision"`
ShortRevision
string
`json:"short_revision"`
Digest
string
`json:"digest"`
CreatedAt
*
time
.
Time
`json:"created_at
,omitempty
"`
CreatedAt
*
time
.
Time
`json:"created_at"`
TotalSize
int
`json:"total_size"`
}
...
...
@@ -47,13 +47,14 @@ func (s RegistryRepositoryTag) String() string {
return
Stringify
(
s
)
}
// ListRegistryRepositoriesOptions represents the available ListRegistryRepositories() options.
// ListRegistryRepositoriesOptions represents the available
// ListRegistryRepositories() options.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories
type
ListRegistryRepositoriesOptions
ListOptions
// ListRegistryRepositories gets a list of registry repositories in a project
y
// ListRegistryRepositories gets a list of registry repositories in a project
.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories
...
...
@@ -74,6 +75,7 @@ func (s *ContainerRegistryService) ListRegistryRepositories(pid interface{}, opt
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
repos
,
resp
,
err
}
...
...
@@ -86,13 +88,13 @@ func (s *ContainerRegistryService) DeleteRegistryRepository(pid interface{}, rep
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/registry/repositories/%d"
,
url
.
QueryEscape
(
project
),
repository
)
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
...
...
@@ -112,7 +114,6 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid interface{}, r
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/registry/repositories/%d/tags"
,
url
.
QueryEscape
(
project
),
repository
,
...
...
@@ -123,12 +124,13 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid interface{}, r
return
nil
,
nil
,
err
}
var
repo
s
[]
*
RegistryRepositoryTag
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
repo
s
)
var
tag
s
[]
*
RegistryRepositoryTag
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
tag
s
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
repos
,
resp
,
err
return
tags
,
resp
,
err
}
// GetRegistryRepositoryTagDetail get details of a registry repository tag
...
...
@@ -140,7 +142,6 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid interface{
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/registry/repositories/%d/tags/%s"
,
url
.
QueryEscape
(
project
),
repository
,
...
...
@@ -152,12 +153,13 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid interface{
return
nil
,
nil
,
err
}
t
d
:=
new
(
RegistryRepositoryTag
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
t
d
)
t
ag
:=
new
(
RegistryRepositoryTag
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
t
ag
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
td
,
resp
,
err
return
tag
,
resp
,
err
}
// DeleteRegistryRepositoryTag deletes a registry repository tag.
...
...
@@ -169,7 +171,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{},
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/registry/repositories/%d/tags/%s"
,
url
.
QueryEscape
(
project
),
repository
,
...
...
@@ -180,6 +181,7 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{},
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
...
...
@@ -194,7 +196,8 @@ type DeleteRegistryRepositoryTagsOptions struct {
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:
// https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk
...
...
@@ -203,7 +206,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid interface{},
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/registry/repositories/%d/tags"
,
url
.
QueryEscape
(
project
),
repository
,
...
...
@@ -213,5 +215,6 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid interface{},
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment