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
df6c9365
Commit
df6c9365
authored
May 18, 2017
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update `VisibilityLevel` to just `Visibility` (#176)
parent
0d95cf7f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
80 deletions
+80
-80
README.md
README.md
+2
-2
events.go
events.go
+0
-0
projects.go
examples/projects.go
+5
-5
gitlab.go
gitlab.go
+8
-8
groups.go
groups.go
+19
-19
project_snippets.go
project_snippets.go
+8
-8
projects.go
projects.go
+0
-0
projects_test.go
projects_test.go
+3
-3
settings.go
settings.go
+35
-35
No files found.
README.md
View file @
df6c9365
...
@@ -87,7 +87,7 @@ func main() {
...
@@ -87,7 +87,7 @@ func main() {
Description
:
gitlab
.
String
(
"Just a test project to play with"
),
Description
:
gitlab
.
String
(
"Just a test project to play with"
),
MergeRequestsEnabled
:
gitlab
.
Bool
(
true
),
MergeRequestsEnabled
:
gitlab
.
Bool
(
true
),
SnippetsEnabled
:
gitlab
.
Bool
(
true
),
SnippetsEnabled
:
gitlab
.
Bool
(
true
),
Visibility
Level
:
gitlab
.
VisibilityLevel
(
gitlab
.
PublicVisibility
),
Visibility
:
gitlab
.
VisibilityLevel
(
gitlab
.
PublicVisibility
),
}
}
project
,
_
,
err
:=
git
.
Projects
.
CreateProject
(
p
)
project
,
_
,
err
:=
git
.
Projects
.
CreateProject
(
p
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -99,7 +99,7 @@ func main() {
...
@@ -99,7 +99,7 @@ func main() {
Title
:
gitlab
.
String
(
"Dummy Snippet"
),
Title
:
gitlab
.
String
(
"Dummy Snippet"
),
FileName
:
gitlab
.
String
(
"snippet.go"
),
FileName
:
gitlab
.
String
(
"snippet.go"
),
Code
:
gitlab
.
String
(
"package main...."
),
Code
:
gitlab
.
String
(
"package main...."
),
Visibility
Level
:
gitlab
.
VisibilityLevel
(
gitlab
.
PublicVisibility
),
Visibility
:
gitlab
.
VisibilityLevel
(
gitlab
.
PublicVisibility
),
}
}
_
,
_
,
err
=
git
.
ProjectSnippets
.
CreateSnippet
(
project
.
ID
,
s
)
_
,
_
,
err
=
git
.
ProjectSnippets
.
CreateSnippet
(
project
.
ID
,
s
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
events.go
View file @
df6c9365
This diff is collapsed.
Click to expand it.
examples/projects.go
View file @
df6c9365
...
@@ -15,7 +15,7 @@ func projectExample() {
...
@@ -15,7 +15,7 @@ func projectExample() {
Description
:
gitlab
.
String
(
"Just a test project to play with"
),
Description
:
gitlab
.
String
(
"Just a test project to play with"
),
MergeRequestsEnabled
:
gitlab
.
Bool
(
true
),
MergeRequestsEnabled
:
gitlab
.
Bool
(
true
),
SnippetsEnabled
:
gitlab
.
Bool
(
true
),
SnippetsEnabled
:
gitlab
.
Bool
(
true
),
Visibility
Level
:
gitlab
.
VisibilityLevel
(
gitlab
.
PublicVisibility
),
Visibility
:
gitlab
.
Visibility
(
gitlab
.
PublicVisibility
),
}
}
project
,
_
,
err
:=
git
.
Projects
.
CreateProject
(
p
)
project
,
_
,
err
:=
git
.
Projects
.
CreateProject
(
p
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -24,10 +24,10 @@ func projectExample() {
...
@@ -24,10 +24,10 @@ func projectExample() {
// Add a new snippet
// Add a new snippet
s
:=
&
gitlab
.
CreateSnippetOptions
{
s
:=
&
gitlab
.
CreateSnippetOptions
{
Title
:
gitlab
.
String
(
"Dummy Snippet"
),
Title
:
gitlab
.
String
(
"Dummy Snippet"
),
FileName
:
gitlab
.
String
(
"snippet.go"
),
FileName
:
gitlab
.
String
(
"snippet.go"
),
Code
:
gitlab
.
String
(
"package main...."
),
Code
:
gitlab
.
String
(
"package main...."
),
Visibility
Level
:
gitlab
.
VisibilityLevel
(
gitlab
.
PublicVisibility
),
Visibility
:
gitlab
.
Visibility
(
gitlab
.
PublicVisibility
),
}
}
_
,
_
,
err
=
git
.
ProjectSnippets
.
CreateSnippet
(
project
.
ID
,
s
)
_
,
_
,
err
=
git
.
ProjectSnippets
.
CreateSnippet
(
project
.
ID
,
s
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
gitlab.go
View file @
df6c9365
...
@@ -127,18 +127,18 @@ var notificationLevelTypes = map[string]NotificationLevelValue{
...
@@ -127,18 +127,18 @@ var notificationLevelTypes = map[string]NotificationLevelValue{
"custom"
:
CustomNotificationLevel
,
"custom"
:
CustomNotificationLevel
,
}
}
// Visibility
Level
Value represents a visibility level within GitLab.
// VisibilityValue represents a visibility level within GitLab.
//
//
// GitLab API docs: https://docs.gitlab.com/ce/api/
// GitLab API docs: https://docs.gitlab.com/ce/api/
type
Visibility
Level
Value
string
type
VisibilityValue
string
// List of available visibility levels
// List of available visibility levels
//
//
// GitLab API docs: https://docs.gitlab.com/ce/api/
// GitLab API docs: https://docs.gitlab.com/ce/api/
const
(
const
(
PrivateVisibility
Visibility
Level
Value
=
"private"
PrivateVisibility
VisibilityValue
=
"private"
InternalVisibility
Visibility
Level
Value
=
"internal"
InternalVisibility
VisibilityValue
=
"internal"
PublicVisibility
Visibility
Level
Value
=
"public"
PublicVisibility
VisibilityValue
=
"public"
)
)
// A Client manages communication with the GitLab API.
// A Client manages communication with the GitLab API.
...
@@ -602,10 +602,10 @@ func NotificationLevel(v NotificationLevelValue) *NotificationLevelValue {
...
@@ -602,10 +602,10 @@ func NotificationLevel(v NotificationLevelValue) *NotificationLevelValue {
return
p
return
p
}
}
// Visibility
Level is a helper routine that allocates a new VisibilityLevel
Value
// Visibility
is a helper routine that allocates a new Visibility
Value
// to store v and returns a pointer to it.
// to store v and returns a pointer to it.
func
Visibility
Level
(
v
VisibilityLevelValue
)
*
VisibilityLevel
Value
{
func
Visibility
(
v
VisibilityValue
)
*
Visibility
Value
{
p
:=
new
(
Visibility
Level
Value
)
p
:=
new
(
VisibilityValue
)
*
p
=
v
*
p
=
v
return
p
return
p
}
}
groups.go
View file @
df6c9365
...
@@ -34,19 +34,19 @@ type GroupsService struct {
...
@@ -34,19 +34,19 @@ type GroupsService struct {
//
//
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html
type
Group
struct
{
type
Group
struct
{
ID
int
`json:"id"`
ID
int
`json:"id"`
Name
string
`json:"name"`
Name
string
`json:"name"`
Path
string
`json:"path"`
Path
string
`json:"path"`
Description
string
`json:"description"`
Description
string
`json:"description"`
AvatarURL
string
`json:"avatar_url"`
AvatarURL
string
`json:"avatar_url"`
FullName
string
`json:"full_name"`
FullName
string
`json:"full_name"`
FullPath
string
`json:"full_path"`
FullPath
string
`json:"full_path"`
LFSEnabled
bool
`json:"lfs_enabled"`
LFSEnabled
bool
`json:"lfs_enabled"`
Projects
[]
*
Project
`json:"projects"`
Projects
[]
*
Project
`json:"projects"`
Statistics
*
StorageStatistics
`json:"statistics"`
Statistics
*
StorageStatistics
`json:"statistics"`
RequestAccessEnabled
bool
`json:"request_access_enabled"`
RequestAccessEnabled
bool
`json:"request_access_enabled"`
Visibility
*
Visibility
LevelValue
`json:"visibility"`
Visibility
*
Visibility
Value
`json:"visibility"`
WebURL
string
`json:"web_url"`
WebURL
string
`json:"web_url"`
}
}
// ListGroupsOptions represents the available ListGroups() options.
// ListGroupsOptions represents the available ListGroups() options.
...
@@ -109,12 +109,12 @@ func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group
...
@@ -109,12 +109,12 @@ func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group
//
//
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#new-group
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#new-group
type
CreateGroupOptions
struct
{
type
CreateGroupOptions
struct
{
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Path
*
string
`url:"path,omitempty" json:"path,omitempty"`
Path
*
string
`url:"path,omitempty" json:"path,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
Visibility
Level
*
VisibilityLevel
Value
`url:"visibility,omitempty" json:"visibility,omitempty"`
Visibility
*
Visibility
Value
`url:"visibility,omitempty" json:"visibility,omitempty"`
}
}
// CreateGroup creates a new project group. Available only for users who can
// CreateGroup creates a new project group. Available only for users who can
...
...
project_snippets.go
View file @
df6c9365
...
@@ -119,10 +119,10 @@ func (s *ProjectSnippetsService) GetSnippet(pid interface{}, snippet int, option
...
@@ -119,10 +119,10 @@ func (s *ProjectSnippetsService) GetSnippet(pid interface{}, snippet int, option
// GitLab API docs:
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#create-new-snippet
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#create-new-snippet
type
CreateSnippetOptions
struct
{
type
CreateSnippetOptions
struct
{
Title
*
string
`url:"title,omitempty" json:"title,omitempty"`
Title
*
string
`url:"title,omitempty" json:"title,omitempty"`
FileName
*
string
`url:"file_name,omitempty" json:"file_name,omitempty"`
FileName
*
string
`url:"file_name,omitempty" json:"file_name,omitempty"`
Code
*
string
`url:"code,omitempty" json:"code,omitempty"`
Code
*
string
`url:"code,omitempty" json:"code,omitempty"`
Visibility
Level
*
VisibilityLevel
Value
`url:"visibility,omitempty" json:"visibility,omitempty"`
Visibility
*
Visibility
Value
`url:"visibility,omitempty" json:"visibility,omitempty"`
}
}
// CreateSnippet creates a new project snippet. The user must have permission
// CreateSnippet creates a new project snippet. The user must have permission
...
@@ -156,10 +156,10 @@ func (s *ProjectSnippetsService) CreateSnippet(pid interface{}, opt *CreateSnipp
...
@@ -156,10 +156,10 @@ func (s *ProjectSnippetsService) CreateSnippet(pid interface{}, opt *CreateSnipp
// GitLab API docs:
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#update-snippet
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#update-snippet
type
UpdateSnippetOptions
struct
{
type
UpdateSnippetOptions
struct
{
Title
*
string
`url:"title,omitempty" json:"title,omitempty"`
Title
*
string
`url:"title,omitempty" json:"title,omitempty"`
FileName
*
string
`url:"file_name,omitempty" json:"file_name,omitempty"`
FileName
*
string
`url:"file_name,omitempty" json:"file_name,omitempty"`
Code
*
string
`url:"code,omitempty" json:"code,omitempty"`
Code
*
string
`url:"code,omitempty" json:"code,omitempty"`
Visibility
Level
*
VisibilityLevel
Value
`url:"visibility,omitempty" json:"visibility,omitempty"`
Visibility
*
Visibility
Value
`url:"visibility,omitempty" json:"visibility,omitempty"`
}
}
// UpdateSnippet updates an existing project snippet. The user must have
// UpdateSnippet updates an existing project snippet. The user must have
...
...
projects.go
View file @
df6c9365
This diff is collapsed.
Click to expand it.
projects_test.go
View file @
df6c9365
...
@@ -33,7 +33,7 @@ func TestListProjects(t *testing.T) {
...
@@ -33,7 +33,7 @@ func TestListProjects(t *testing.T) {
Sort
:
String
(
"asc"
),
Sort
:
String
(
"asc"
),
Search
:
String
(
"query"
),
Search
:
String
(
"query"
),
Simple
:
Bool
(
true
),
Simple
:
Bool
(
true
),
Visibility
:
Visibility
Level
(
PublicVisibility
),
Visibility
:
Visibility
(
PublicVisibility
),
}
}
projects
,
_
,
err
:=
client
.
Projects
.
ListProjects
(
opt
)
projects
,
_
,
err
:=
client
.
Projects
.
ListProjects
(
opt
)
...
@@ -75,7 +75,7 @@ func TestListOwnedProjects(t *testing.T) {
...
@@ -75,7 +75,7 @@ func TestListOwnedProjects(t *testing.T) {
Search
:
String
(
"query"
),
Search
:
String
(
"query"
),
Simple
:
Bool
(
true
),
Simple
:
Bool
(
true
),
Owned
:
Bool
(
true
),
Owned
:
Bool
(
true
),
Visibility
:
Visibility
Level
(
PublicVisibility
),
Visibility
:
Visibility
(
PublicVisibility
),
}
}
projects
,
_
,
err
:=
client
.
Projects
.
ListProjects
(
opt
)
projects
,
_
,
err
:=
client
.
Projects
.
ListProjects
(
opt
)
...
@@ -117,7 +117,7 @@ func TestListStarredProjects(t *testing.T) {
...
@@ -117,7 +117,7 @@ func TestListStarredProjects(t *testing.T) {
Search
:
String
(
"query"
),
Search
:
String
(
"query"
),
Simple
:
Bool
(
true
),
Simple
:
Bool
(
true
),
Starred
:
Bool
(
true
),
Starred
:
Bool
(
true
),
Visibility
:
Visibility
Level
(
PublicVisibility
),
Visibility
:
Visibility
(
PublicVisibility
),
}
}
projects
,
_
,
err
:=
client
.
Projects
.
ListProjects
(
opt
)
projects
,
_
,
err
:=
client
.
Projects
.
ListProjects
(
opt
)
...
...
settings.go
View file @
df6c9365
...
@@ -32,25 +32,25 @@ type SettingsService struct {
...
@@ -32,25 +32,25 @@ type SettingsService struct {
// GitLab API docs:
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md
type
Settings
struct
{
type
Settings
struct
{
ID
int
`json:"id"`
ID
int
`json:"id"`
DefaultProjectsLimit
int
`json:"default_projects_limit"`
DefaultProjectsLimit
int
`json:"default_projects_limit"`
SignupEnabled
bool
`json:"signup_enabled"`
SignupEnabled
bool
`json:"signup_enabled"`
SigninEnabled
bool
`json:"signin_enabled"`
SigninEnabled
bool
`json:"signin_enabled"`
GravatarEnabled
bool
`json:"gravatar_enabled"`
GravatarEnabled
bool
`json:"gravatar_enabled"`
SignInText
string
`json:"sign_in_text"`
SignInText
string
`json:"sign_in_text"`
CreatedAt
*
time
.
Time
`json:"created_at"`
CreatedAt
*
time
.
Time
`json:"created_at"`
UpdatedAt
*
time
.
Time
`json:"updated_at"`
UpdatedAt
*
time
.
Time
`json:"updated_at"`
HomePageURL
string
`json:"home_page_url"`
HomePageURL
string
`json:"home_page_url"`
DefaultBranchProtection
int
`json:"default_branch_protection"`
DefaultBranchProtection
int
`json:"default_branch_protection"`
TwitterSharingEnabled
bool
`json:"twitter_sharing_enabled"`
TwitterSharingEnabled
bool
`json:"twitter_sharing_enabled"`
RestrictedVisibilityLevels
[]
Visibility
Level
Value
`json:"restricted_visibility_levels"`
RestrictedVisibilityLevels
[]
VisibilityValue
`json:"restricted_visibility_levels"`
MaxAttachmentSize
int
`json:"max_attachment_size"`
MaxAttachmentSize
int
`json:"max_attachment_size"`
SessionExpireDelay
int
`json:"session_expire_delay"`
SessionExpireDelay
int
`json:"session_expire_delay"`
DefaultProjectVisibility
int
`json:"default_project_visibility"`
DefaultProjectVisibility
int
`json:"default_project_visibility"`
DefaultSnippetVisibility
int
`json:"default_snippet_visibility"`
DefaultSnippetVisibility
int
`json:"default_snippet_visibility"`
RestrictedSignupDomains
[]
string
`json:"restricted_signup_domains"`
RestrictedSignupDomains
[]
string
`json:"restricted_signup_domains"`
UserOauthApplications
bool
`json:"user_oauth_applications"`
UserOauthApplications
bool
`json:"user_oauth_applications"`
AfterSignOutPath
string
`json:"after_sign_out_path"`
AfterSignOutPath
string
`json:"after_sign_out_path"`
}
}
func
(
s
Settings
)
String
()
string
{
func
(
s
Settings
)
String
()
string
{
...
@@ -81,22 +81,22 @@ func (s *SettingsService) GetSettings(options ...OptionFunc) (*Settings, *Respon
...
@@ -81,22 +81,22 @@ func (s *SettingsService) GetSettings(options ...OptionFunc) (*Settings, *Respon
// GitLab API docs:
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md#change-application.settings
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md#change-application.settings
type
UpdateSettingsOptions
struct
{
type
UpdateSettingsOptions
struct
{
DefaultProjectsLimit
*
int
`url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"`
DefaultProjectsLimit
*
int
`url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"`
SignupEnabled
*
bool
`url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"`
SignupEnabled
*
bool
`url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"`
SigninEnabled
*
bool
`url:"signin_enabled,omitempty" json:"signin_enabled,omitempty"`
SigninEnabled
*
bool
`url:"signin_enabled,omitempty" json:"signin_enabled,omitempty"`
GravatarEnabled
*
bool
`url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"`
GravatarEnabled
*
bool
`url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"`
SignInText
*
string
`url:"sign_in_text,omitempty" json:"sign_in_text,omitempty"`
SignInText
*
string
`url:"sign_in_text,omitempty" json:"sign_in_text,omitempty"`
HomePageURL
*
string
`url:"home_page_url,omitempty" json:"home_page_url,omitempty"`
HomePageURL
*
string
`url:"home_page_url,omitempty" json:"home_page_url,omitempty"`
DefaultBranchProtection
*
int
`url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"`
DefaultBranchProtection
*
int
`url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"`
TwitterSharingEnabled
*
bool
`url:"twitter_sharing_enabled,omitempty" json:"twitter_sharing_enabled,omitempty"`
TwitterSharingEnabled
*
bool
`url:"twitter_sharing_enabled,omitempty" json:"twitter_sharing_enabled,omitempty"`
RestrictedVisibilityLevels
[]
Visibility
Level
Value
`url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,omitempty"`
RestrictedVisibilityLevels
[]
VisibilityValue
`url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,omitempty"`
MaxAttachmentSize
*
int
`url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"`
MaxAttachmentSize
*
int
`url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"`
SessionExpireDelay
*
int
`url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"`
SessionExpireDelay
*
int
`url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"`
DefaultProjectVisibility
*
int
`url:"default_project_visibility,omitempty" json:"default_project_visibility,omitempty"`
DefaultProjectVisibility
*
int
`url:"default_project_visibility,omitempty" json:"default_project_visibility,omitempty"`
DefaultSnippetVisibility
*
int
`url:"default_snippet_visibility,omitempty" json:"default_snippet_visibility,omitempty"`
DefaultSnippetVisibility
*
int
`url:"default_snippet_visibility,omitempty" json:"default_snippet_visibility,omitempty"`
RestrictedSignupDomains
[]
string
`url:"restricted_signup_domains,omitempty" json:"restricted_signup_domains,omitempty"`
RestrictedSignupDomains
[]
string
`url:"restricted_signup_domains,omitempty" json:"restricted_signup_domains,omitempty"`
UserOauthApplications
*
bool
`url:"user_oauth_applications,omitempty" json:"user_oauth_applications,omitempty"`
UserOauthApplications
*
bool
`url:"user_oauth_applications,omitempty" json:"user_oauth_applications,omitempty"`
AfterSignOutPath
*
string
`url:"after_sign_out_path,omitempty" json:"after_sign_out_path,omitempty"`
AfterSignOutPath
*
string
`url:"after_sign_out_path,omitempty" json:"after_sign_out_path,omitempty"`
}
}
// UpdateSettings updates the application settings.
// UpdateSettings updates the application settings.
...
...
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