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
760a3395
Commit
760a3395
authored
May 16, 2017
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all the Group related calls consistent
parent
ef44af32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
groups.go
groups.go
+17
-18
No files found.
groups.go
View file @
760a3395
...
@@ -36,15 +36,14 @@ type GroupsService struct {
...
@@ -36,15 +36,14 @@ type GroupsService struct {
// GitLab API docs:
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md
type
Group
struct
{
type
Group
struct
{
ID
int
`json:"id"`
ID
int
`json:"id"`
Name
string
`json:"name"`
Name
string
`json:"name"`
Path
string
`json:"path"`
Path
string
`json:"path"`
Description
string
`json:"description"`
Description
string
`json:"description"`
VisibilityLevel
VisibilityLevelValue
`json:"visibility_level"`
LFSEnabled
bool
`json:"lfs_enabled"`
LFSEnabled
bool
`json:"lfs_enabled"`
Projects
[]
*
Project
`json:"projects"`
RequestAccessEnabled
bool
`json:"request_access_enabled"`
Statistics
*
StorageStatistics
`json:"statistics"`
Projects
[]
*
Project
`json:"projects"`
VisibilityLevel
VisibilityLevelValue
`json:"visibility_level"`
Statistics
*
StorageStatistics
`json:"statistics"`
}
}
// ListGroupsOptions represents the available ListGroups() options.
// ListGroupsOptions represents the available ListGroups() options.
...
@@ -85,7 +84,7 @@ func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group
...
@@ -85,7 +84,7 @@ func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s"
,
group
)
u
:=
fmt
.
Sprintf
(
"groups/%s"
,
url
.
QueryEscape
(
group
)
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -109,9 +108,9 @@ type CreateGroupOptions struct {
...
@@ -109,9 +108,9 @@ type CreateGroupOptions struct {
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Path
*
string
`url:"path,omitempty" json:"path,omitempty"`
Path
*
string
`url:"path,omitempty" json:"path,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
VisibilityLevel
*
VisibilityLevelValue
`url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
VisibilityLevel
*
VisibilityLevelValue
`url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
}
}
// CreateGroup creates a new project group. Available only for users who can
// CreateGroup creates a new project group. Available only for users who can
...
@@ -177,7 +176,7 @@ func (s *GroupsService) TransferGroup(gid interface{}, project int, options ...O
...
@@ -177,7 +176,7 @@ func (s *GroupsService) TransferGroup(gid interface{}, project int, options ...O
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s/projects/%d"
,
group
,
project
)
u
:=
fmt
.
Sprintf
(
"groups/%s/projects/%d"
,
url
.
QueryEscape
(
group
)
,
project
)
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -202,7 +201,7 @@ func (s *GroupsService) DeleteGroup(gid interface{}, options ...OptionFunc) (*Re
...
@@ -202,7 +201,7 @@ func (s *GroupsService) DeleteGroup(gid interface{}, options ...OptionFunc) (*Re
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s"
,
group
)
u
:=
fmt
.
Sprintf
(
"groups/%s"
,
url
.
QueryEscape
(
group
)
)
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -269,7 +268,7 @@ func (s *GroupsService) ListGroupMembers(gid interface{}, opt *ListGroupMembersO
...
@@ -269,7 +268,7 @@ func (s *GroupsService) ListGroupMembers(gid interface{}, opt *ListGroupMembersO
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s/members"
,
group
)
u
:=
fmt
.
Sprintf
(
"groups/%s/members"
,
url
.
QueryEscape
(
group
)
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -303,7 +302,7 @@ func (s *GroupsService) ListGroupProjects(gid interface{}, opt *ListGroupProject
...
@@ -303,7 +302,7 @@ func (s *GroupsService) ListGroupProjects(gid interface{}, opt *ListGroupProject
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s/projects"
,
group
)
u
:=
fmt
.
Sprintf
(
"groups/%s/projects"
,
url
.
QueryEscape
(
group
)
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -337,7 +336,7 @@ func (s *GroupsService) AddGroupMember(gid interface{}, opt *AddGroupMemberOptio
...
@@ -337,7 +336,7 @@ func (s *GroupsService) AddGroupMember(gid interface{}, opt *AddGroupMemberOptio
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s/members"
,
group
)
u
:=
fmt
.
Sprintf
(
"groups/%s/members"
,
url
.
QueryEscape
(
group
)
)
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
opt
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
opt
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -371,7 +370,7 @@ func (s *GroupsService) UpdateGroupMember(gid interface{}, user int, opt *Update
...
@@ -371,7 +370,7 @@ func (s *GroupsService) UpdateGroupMember(gid interface{}, user int, opt *Update
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s/members/%d"
,
group
,
user
)
u
:=
fmt
.
Sprintf
(
"groups/%s/members/%d"
,
url
.
QueryEscape
(
group
)
,
user
)
req
,
err
:=
s
.
client
.
NewRequest
(
"PUT"
,
u
,
opt
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"PUT"
,
u
,
opt
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -396,7 +395,7 @@ func (s *GroupsService) RemoveGroupMember(gid interface{}, user int, options ...
...
@@ -396,7 +395,7 @@ func (s *GroupsService) RemoveGroupMember(gid interface{}, user int, options ...
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"groups/%s/members/%d"
,
group
,
user
)
u
:=
fmt
.
Sprintf
(
"groups/%s/members/%d"
,
url
.
QueryEscape
(
group
)
,
user
)
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
if
err
!=
nil
{
if
err
!=
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