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
b704221d
Commit
b704221d
authored
Feb 21, 2019
by
Sindre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GetProjectOptions
parent
c99c64bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
projects.go
projects.go
+11
-2
No files found.
projects.go
View file @
b704221d
...
...
@@ -320,19 +320,28 @@ func (s *ProjectsService) GetProjectLanguages(pid interface{}, options ...Option
return
p
,
resp
,
err
}
// GetProjectOptions represents the available GetProject() options.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#get-single-project
type
GetProjectOptions
struct
{
Statistics
*
bool
`url:"statistics,omitempty" json:"statistics,omitempty"`
License
*
bool
`url:"license,omitempty" json:"license,omitempty"`
WithCustomAttributes
*
bool
`url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
}
// GetProject gets a specific project, identified by project ID or
// NAMESPACE/PROJECT_NAME, which is owned by the authenticated user.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#get-single-project
func
(
s
*
ProjectsService
)
GetProject
(
pid
interface
{},
options
...
OptionFunc
)
(
*
Project
,
*
Response
,
error
)
{
func
(
s
*
ProjectsService
)
GetProject
(
pid
interface
{},
opt
*
GetProjectOptions
,
opt
ions
...
OptionFunc
)
(
*
Project
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s"
,
url
.
QueryEscape
(
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