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
b83e6697
Unverified
Commit
b83e6697
authored
Sep 11, 2019
by
Sander van Harmelen
Committed by
GitHub
Sep 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #676 from leominov/feature/group-project-variables-list-options
Add ListOptions in Group and Project ListVariables
parents
b358b175
8007c9bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
group_variables.go
group_variables.go
+9
-2
project_variables.go
project_variables.go
+9
-2
No files found.
group_variables.go
View file @
b83e6697
...
...
@@ -45,18 +45,25 @@ func (v GroupVariable) String() string {
return
Stringify
(
v
)
}
// ListGroupVariablesOptions represents the available options for listing variables
// for a group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_level_variables.html#list-group-variables
type
ListGroupVariablesOptions
ListOptions
// ListVariables gets a list of all variables for a group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_level_variables.html#list-group-variables
func
(
s
*
GroupVariablesService
)
ListVariables
(
gid
interface
{},
options
...
OptionFunc
)
([]
*
GroupVariable
,
*
Response
,
error
)
{
func
(
s
*
GroupVariablesService
)
ListVariables
(
gid
interface
{},
opt
*
ListGroupVariablesOptions
,
opt
ions
...
OptionFunc
)
([]
*
GroupVariable
,
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"groups/%s/variables"
,
pathEscape
(
group
))
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
...
...
project_variables.go
View file @
b83e6697
...
...
@@ -47,18 +47,25 @@ func (v ProjectVariable) String() string {
return
Stringify
(
v
)
}
// ListProjectVariablesOptions represents the available options for listing variables
// in a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_level_variables.html#list-project-variables
type
ListProjectVariablesOptions
ListOptions
// ListVariables gets a list of all variables in a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_level_variables.html#list-project-variables
func
(
s
*
ProjectVariablesService
)
ListVariables
(
pid
interface
{},
options
...
OptionFunc
)
([]
*
ProjectVariable
,
*
Response
,
error
)
{
func
(
s
*
ProjectVariablesService
)
ListVariables
(
pid
interface
{},
opt
*
ListProjectVariablesOptions
,
opt
ions
...
OptionFunc
)
([]
*
ProjectVariable
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/variables"
,
pathEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
...
...
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