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
5b2afcf9
Unverified
Commit
5b2afcf9
authored
Mar 27, 2019
by
Sander van Harmelen
Committed by
GitHub
Mar 27, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #592 from itscaro/quan/services-external-wiki
add external wiki service
parents
57bae63d
34ad79c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
services.go
services.go
+89
-0
No files found.
services.go
View file @
5b2afcf9
...
...
@@ -647,3 +647,92 @@ func (s *ServicesService) DeleteMicrosoftTeamsService(pid interface{}, options .
return
s
.
client
.
Do
(
req
,
nil
)
}
// ExternalWikiService represents External Wiki service settings.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#external-wiki
type
ExternalWikiService
struct
{
Service
Properties
*
ExternalWikiServiceProperties
`json:"properties"`
}
// ExternalWikiServiceProperties represents External Wiki specific properties.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#external-wiki
type
ExternalWikiServiceProperties
struct
{
ExternalWikiURL
string
`json:"external_wiki_url"`
}
// GetExternalWikiService gets External Wiki service settings for a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#get-external-wiki-service-settings
func
(
s
*
ServicesService
)
GetExternalWikiService
(
pid
interface
{},
options
...
OptionFunc
)
(
*
ExternalWikiService
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/services/external-wiki"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
svc
:=
new
(
ExternalWikiService
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
svc
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
svc
,
resp
,
err
}
// SetExternalWikiServiceOptions represents the available SetExternalWikiService()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#createedit-external-wiki-service
type
SetExternalWikiServiceOptions
struct
{
ExternalWikiURL
*
string
`url:"external_wiki_url,omitempty" json:"external_wiki_url,omitempty"`
}
// SetExternalWikiService sets External Wiki service for a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#createedit-external-wiki-service
func
(
s
*
ServicesService
)
SetExternalWikiService
(
pid
interface
{},
opt
*
SetExternalWikiServiceOptions
,
options
...
OptionFunc
)
(
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/services/external-wiki"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"PUT"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
// DeleteExternalWikiService deletes External Wiki service for project.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#delete-external-wiki-service
func
(
s
*
ServicesService
)
DeleteExternalWikiService
(
pid
interface
{},
options
...
OptionFunc
)
(
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/services/external-wiki"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
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