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
b6b10eeb
Commit
b6b10eeb
authored
Dec 20, 2017
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak comments…
parent
3f9374bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
labels.go
labels.go
+8
-8
protected_branches.go
protected_branches.go
+13
-14
No files found.
labels.go
View file @
b6b10eeb
...
...
@@ -21,8 +21,8 @@ import (
"net/url"
)
// LabelsService handles communication with the label related methods
//
of the
GitLab API.
// LabelsService handles communication with the label related methods
of the
// GitLab API.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/labels.html
type
LabelsService
struct
{
...
...
@@ -164,8 +164,8 @@ func (s *LabelsService) UpdateLabel(pid interface{}, opt *UpdateLabelOptions, op
}
// SubscribeToLabel subscribes the authenticated user to a label to receive
// notifications. If the user is already subscribed to the label,
//
the status
code 304 is returned.
// notifications. If the user is already subscribed to the label,
the status
// code 304 is returned.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/labels.html#subscribe-to-a-label
...
...
@@ -188,15 +188,15 @@ func (s *LabelsService) SubscribeToLabel(pid interface{}, labelID interface{}, o
l
:=
new
(
Label
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
l
)
if
err
!=
nil
{
return
nil
,
resp
,
err
return
nil
,
resp
,
err
}
return
l
,
resp
,
err
}
// UnsubscribeFromLabel unsubscribes the authenticated user from a label
//
to not receive notifications from it. If the user is not subscribed
//
to the label, the
status code 304 is returned.
// UnsubscribeFromLabel unsubscribes the authenticated user from a label
to not
//
receive notifications from it. If the user is not subscribed to the label, the
// status code 304 is returned.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/labels.html#unsubscribe-from-a-label
...
...
protected_branches.go
View file @
b6b10eeb
...
...
@@ -21,8 +21,8 @@ import (
"net/url"
)
// ProtectedBranchesService handles communication with the
//
protected branch
related methods of the GitLab API.
// ProtectedBranchesService handles communication with the
protected branch
// related methods of the GitLab API.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api
...
...
@@ -30,8 +30,8 @@ type ProtectedBranchesService struct {
client
*
Client
}
// BranchAccessDescription represents the access description for a
//
protected branch
// BranchAccessDescription represents the access description for a
protected
//
branch.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api
...
...
@@ -40,7 +40,7 @@ type BranchAccessDescription struct {
AccessLevelDescription
string
`json:"access_level_description"`
}
// ProtectedBranch represents a protected branch
// ProtectedBranch represents a protected branch
.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches
...
...
@@ -50,7 +50,7 @@ type ProtectedBranch struct {
MergeAccessLevels
[]
*
BranchAccessDescription
`json:"merge_access_levels"`
}
// ListProtectedBranches gets a list of protected branches from a project
// ListProtectedBranches gets a list of protected branches from a project
.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches
...
...
@@ -75,17 +75,16 @@ func (s *ProtectedBranchesService) ListProtectedBranches(pid interface{}, option
return
p
,
resp
,
err
}
// GetProtectedBranch gets a single protected branch
// or wildcard protected branch
// GetProtectedBranch gets a single protected branch or wildcard protected branch.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#get-a-single-protected-branch-or-wildcard-protected-branch
func
(
s
*
ProtectedBranchesService
)
GetProtectedBranch
(
pid
interface
{},
name
string
,
options
...
OptionFunc
)
(
*
ProtectedBranch
,
*
Response
,
error
)
{
func
(
s
*
ProtectedBranchesService
)
GetProtectedBranch
(
pid
interface
{},
branch
string
,
options
...
OptionFunc
)
(
*
ProtectedBranch
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/protected_branches/%s"
,
url
.
QueryEscape
(
project
),
name
)
u
:=
fmt
.
Sprintf
(
"projects/%s/protected_branches/%s"
,
url
.
QueryEscape
(
project
),
branch
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
if
err
!=
nil
{
...
...
@@ -138,17 +137,17 @@ func (s *ProtectedBranchesService) ProtectRepositoryBranches(pid interface{}, op
return
p
,
resp
,
err
}
// UnprotectRepositoryBranches unprotects the given protected branch
//
or wildcard protected branch
// UnprotectRepositoryBranches unprotects the given protected branch
or wildcard
//
protected branch.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#unprotect-repository-branches
func
(
s
*
ProtectedBranchesService
)
UnprotectRepositoryBranches
(
pid
interface
{},
name
string
,
options
...
OptionFunc
)
(
*
Response
,
error
)
{
func
(
s
*
ProtectedBranchesService
)
UnprotectRepositoryBranches
(
pid
interface
{},
branch
string
,
options
...
OptionFunc
)
(
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/protected_branches/%s"
,
url
.
QueryEscape
(
project
),
name
)
u
:=
fmt
.
Sprintf
(
"projects/%s/protected_branches/%s"
,
url
.
QueryEscape
(
project
),
branch
)
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