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
606bc4d6
Commit
606bc4d6
authored
Mar 03, 2019
by
Roli Christen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduced type for badge kind + some code clean up
parent
e5bc3c3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
group_badges.go
group_badges.go
+19
-11
No files found.
group_badges.go
View file @
606bc4d6
...
...
@@ -5,6 +5,23 @@ import (
"net/url"
)
// GroupBadgesService handles communication with the group badges
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_badges.html
type
GroupBadgesService
struct
{
client
*
Client
}
// BadgeKind represents a GitLab Badge Kind
type
BadgeKind
string
// all possible values Badge Kind
const
(
ProjectBadgeKind
BadgeKind
=
"project"
GroupBadgeKind
BadgeKind
=
"group"
)
// GroupBadge represents a group badge.
//
// GitLab API docs:
...
...
@@ -15,16 +32,7 @@ type GroupBadge struct {
ImageURL
string
`json:"image_url"`
RenderedLinkURL
string
`json:"rendered_link_url"`
RenderedImageURL
string
`json:"rendered_image_url"`
// Kind represents a project badge kind. Can be empty, when used PreviewProjectBadge().
Kind
string
`json:"kind"`
}
// GroupBadgesService handles communication with the group badges
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_badges.html
type
GroupBadgesService
struct
{
client
*
Client
Kind
BadgeKind
`json:"kind"`
}
// ListGroupBadgesOptions represents the available ListGroupBadges() options.
...
...
@@ -160,7 +168,7 @@ func (s *GroupBadgesService) DeleteGroupBadge(gid interface{}, badge int, option
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"group/%s/badges/%d"
,
url
.
QueryEscape
(
group
),
badge
)
u
:=
fmt
.
Sprintf
(
"group
s
/%s/badges/%d"
,
url
.
QueryEscape
(
group
),
badge
)
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