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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
groups.go
groups.go
+10
-11
No files found.
groups.go
View file @
760a3395
...
...
@@ -40,11 +40,10 @@ type Group struct {
Name
string
`json:"name"`
Path
string
`json:"path"`
Description
string
`json:"description"`
VisibilityLevel
VisibilityLevelValue
`json:"visibility_level"`
LFSEnabled
bool
`json:"lfs_enabled"`
RequestAccessEnabled
bool
`json:"request_access_enabled"`
Projects
[]
*
Project
`json:"projects"`
Statistics
*
StorageStatistics
`json:"statistics"`
VisibilityLevel
VisibilityLevelValue
`json:"visibility_level"`
}
// ListGroupsOptions represents the available ListGroups() options.
...
...
@@ -85,7 +84,7 @@ func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -109,9 +108,9 @@ type CreateGroupOptions struct {
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Path
*
string
`url:"path,omitempty" json:"path,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"`
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
...
...
@@ -177,7 +176,7 @@ func (s *GroupsService) TransferGroup(gid interface{}, project int, options ...O
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -202,7 +201,7 @@ func (s *GroupsService) DeleteGroup(gid interface{}, options ...OptionFunc) (*Re
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -269,7 +268,7 @@ func (s *GroupsService) ListGroupMembers(gid interface{}, opt *ListGroupMembersO
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -303,7 +302,7 @@ func (s *GroupsService) ListGroupProjects(gid interface{}, opt *ListGroupProject
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -337,7 +336,7 @@ func (s *GroupsService) AddGroupMember(gid interface{}, opt *AddGroupMemberOptio
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -371,7 +370,7 @@ func (s *GroupsService) UpdateGroupMember(gid interface{}, user int, opt *Update
if
err
!=
nil
{
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
)
if
err
!=
nil
{
...
...
@@ -396,7 +395,7 @@ func (s *GroupsService) RemoveGroupMember(gid interface{}, user int, options ...
if
err
!=
nil
{
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
)
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