gitlab

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

go-gitlab

A GitLab API client enabling Go programs to interact with GitLab in a simple and uniform way

Documentation: GoDoc Build Status: Build Status

NOTE

This branch contains the last version that fully supports the V3 Gitlab API. There will be no active maintenance on this branch other then bugfixes. Please use master to get the latest version supporting the V4 API.

Coverage

This API client package covers 100% of the existing GitLab API calls! So this includes all calls to the following services:

  • Users
  • Session
  • Projects (including setting Webhooks)
  • Project Snippets
  • Services
  • Repositories
  • Repository Files
  • Commits
  • Branches
  • Merge Requests
  • Issues
  • Labels
  • Milestones
  • Notes (comments)
  • Deploy Keys
  • System Hooks
  • Groups
  • Namespaces
  • Settings
  • Pipelines
  • Version

Usage

import "github.com/xanzy/go-gitlab"

Construct a new GitLab client, then use the various services on the client to access different parts of the GitLab API. For example, to list all users:

git := gitlab.NewClient(nil, "yourtokengoeshere")
//git.SetBaseURL("https://git.mydomain.com/api/v3")
users, _, err := git.Users.ListUsers()

Some API methods have optional parameters that can be passed. For example, to list all projects for user "svanharmelen":

git := gitlab.NewClient(nil)
opt := &ListProjectsOptions{Search: gitlab.String("svanharmelen")}
projects, _, err := git.Projects.ListProjects(opt)
Examples

The examples directory contains a couple for clear examples, of which one is partially listed here as well:

package main

import (
	"log"

	"github.com/xanzy/go-gitlab"
)

func main() {
	git := gitlab.NewClient(nil, "yourtokengoeshere")

	// Create new project
	p := &gitlab.CreateProjectOptions{
		Name:                 gitlab.String("My Project"),
		Description:          gitlab.String("Just a test project to play with"),
		MergeRequestsEnabled: gitlab.Bool(true),
		SnippetsEnabled:      gitlab.Bool(true),
		VisibilityLevel:      gitlab.VisibilityLevel(gitlab.PublicVisibility),
	}
	project, _, err := git.Projects.CreateProject(p)
	if err != nil {
		log.Fatal(err)
	}

	// Add a new snippet
	s := &gitlab.CreateSnippetOptions{
		Title:           gitlab.String("Dummy Snippet"),
		FileName:        gitlab.String("snippet.go"),
		Code:            gitlab.String("package main...."),
		VisibilityLevel: gitlab.VisibilityLevel(gitlab.PublicVisibility),
	}
	_, _, err = git.ProjectSnippets.CreateSnippet(project.ID, s)
	if err != nil {
		log.Fatal(err)
	}
}

For complete usage of go-gitlab, see the full package docs.

ToDo

  • The biggest thing this package still needs is tests 😞

Issues

Author

Sander van Harmelen (sander@xanzy.io)

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

func Stringify

func Stringify(message interface{}) string

Stringify attempts to create a reasonable string representation of types in the GitHub library. It does things like resolve pointers to their values and omits struct fields with nil values.

Types

type AcceptMergeRequestOptions

type AcceptMergeRequestOptions struct {
	MergeCommitMessage       *string `url:"merge_commit_message,omitempty" json:"merge_commit_message,omitempty"`
	ShouldRemoveSourceBranch *bool   `url:"should_remove_source_branch,omitempty" json:"should_remove_source_branch,omitempty"`
	MergeWhenBuildSucceeds   *bool   `url:"merge_when_build_succeeds,omitempty" json:"merge_when_build_succeeds,omitempty"`
	Sha                      *string `url:"sha,omitempty" json:"sha,omitempty"`
}

AcceptMergeRequestOptions represents the available AcceptMergeRequest() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#accept-mr

type AccessLevelValue

type AccessLevelValue int

AccessLevelValue represents a permission level within GitLab.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/permissions/permissions.md

const (
	GuestPermissions     AccessLevelValue = 10
	ReporterPermissions  AccessLevelValue = 20
	DeveloperPermissions AccessLevelValue = 30
	MasterPermissions    AccessLevelValue = 40
	OwnerPermission      AccessLevelValue = 50
)

List of available access levels

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/permissions/permissions.md

func AccessLevel

func AccessLevel(v AccessLevelValue) *AccessLevelValue

AccessLevel is a helper routine that allocates a new AccessLevelValue to store v and returns a pointer to it.

type AddDeployKeyOptions

type AddDeployKeyOptions struct {
	Title   *string `url:"title,omitempty" json:"title,omitempty"`
	Key     *string `url:"key,omitempty" json:"key,omitempty"`
	CanPush *bool   `url:"can_push,omitempty" json:"can_push,omitempty"`
}

AddDeployKeyOptions represents the available ADDDeployKey() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/deploy_keys.md#add-deploy-key

type AddEmailOptions

type AddEmailOptions struct {
	Email *string `url:"email,omitempty" json:"email,omitempty"`
}

AddEmailOptions represents the available AddEmail() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#add-email

type AddGroupMemberOptions

type AddGroupMemberOptions struct {
	UserID      *int              `url:"user_id,omitempty" json:"user_id,omitempty"`
	AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
}

AddGroupMemberOptions represents the available AddGroupMember() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#add-group-member

type AddHookOptions

type AddHookOptions struct {
	URL *string `url:"url,omitempty" json:"url,omitempty"`
}

AddHookOptions represents the available AddHook() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md#add-new-system-hook-hook

type AddProjectHookOptions

type AddProjectHookOptions struct {
	URL                   *string `url:"url,omitempty" json:"url,omitempty"`
	PushEvents            *bool   `url:"push_events,omitempty" json:"push_events,omitempty"`
	IssuesEvents          *bool   `url:"issues_events,omitempty" json:"issues_events,omitempty"`
	MergeRequestsEvents   *bool   `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
	TagPushEvents         *bool   `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
	NoteEvents            *bool   `url:"note_events,omitempty" json:"note_events,omitempty"`
	BuildEvents           *bool   `url:"build_events,omitempty" json:"build_events,omitempty"`
	PipelineEvents        *bool   `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
	WikiPageEvents        *bool   `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
	EnableSSLVerification *bool   `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
	Token                 *string `url:"token,omitempty" json:"token,omitempty"`
}

AddProjectHookOptions represents the available AddProjectHook() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#add-project-hook

type AddProjectMemberOptions

type AddProjectMemberOptions struct {
	UserID      *int              `url:"user_id,omitempty" json:"user_id,omitempty"`
	AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
}

AddProjectMemberOptions represents the available AddProjectMember() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#add-project-team-member

type AddSSHKeyOptions

type AddSSHKeyOptions struct {
	Title *string `url:"title,omitempty" json:"title,omitempty"`
	Key   *string `url:"key,omitempty" json:"key,omitempty"`
}

AddSSHKeyOptions represents the available AddSSHKey() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#add-ssh-key

type AddSpentTimeOptions

type AddSpentTimeOptions struct {
	Duration *string `url:"duration,omitempty" json:"duration,omitempty"`
}

AddSpentTimeOptions represents the available AddSpentTime() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#add-spent-time-for-an-issue

type ArchiveOptions

type ArchiveOptions struct {
	SHA *string `url:"sha,omitempty" json:"sha,omitempty"`
}

ArchiveOptions represents the available Archive() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#get-file-archive

type Author

type Author struct {
	ID        int        `json:"id"`
	Username  string     `json:"username"`
	Email     string     `json:"email"`
	Name      string     `json:"name"`
	State     string     `json:"state"`
	Blocked   bool       `json:"blocked"`
	CreatedAt *time.Time `json:"created_at"`
}

Author represents a GitLab commit author

type Branch

type Branch struct {
	Commit             *Commit `json:"commit"`
	Name               string  `json:"name"`
	Protected          bool    `json:"protected"`
	Merged             bool    `json:"merged"`
	DevelopersCanPush  bool    `json:"developers_can_push"`
	DevelopersCanMerge bool    `json:"developers_can_merge"`
}

Branch represents a GitLab branch.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md

func (Branch) String

func (b Branch) String() string

type BranchesService

type BranchesService struct {
	// contains filtered or unexported fields
}

BranchesService handles communication with the branch related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md

func (*BranchesService) CreateBranch

func (s *BranchesService) CreateBranch(pid interface{}, opt *CreateBranchOptions, options ...OptionFunc) (*Branch, *Response, error)

CreateBranch creates branch from commit SHA or existing branch.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#create-repository-branch

func (*BranchesService) DeleteBranch

func (s *BranchesService) DeleteBranch(pid interface{}, branch string, options ...OptionFunc) (*Response, error)

DeleteBranch deletes an existing branch.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#delete-repository-branch

func (*BranchesService) DeleteMergedBranches

func (s *BranchesService) DeleteMergedBranches(pid interface{}, options ...OptionFunc) (*Response, error)

DeleteMergedBranches deletes all branches that are merged into the project's default branch.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#delete-merged-branches

func (*BranchesService) GetBranch

func (s *BranchesService) GetBranch(pid interface{}, branch string, options ...OptionFunc) (*Branch, *Response, error)

GetBranch gets a single project repository branch.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#get-single-repository-branch

func (*BranchesService) ListBranches

func (s *BranchesService) ListBranches(pid interface{}, opts *ListBranchesOptions, options ...OptionFunc) ([]*Branch, *Response, error)

ListBranches gets a list of repository branches from a project, sorted by name alphabetically.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#list-repository-branches

func (*BranchesService) ProtectBranch

func (s *BranchesService) ProtectBranch(pid interface{}, branch string, opts *ProtectBranchOptions, options ...OptionFunc) (*Branch, *Response, error)

ProtectBranch protects a single project repository branch. This is an idempotent function, protecting an already protected repository branch still returns a 200 OK status code.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#protect-repository-branch

func (*BranchesService) UnprotectBranch

func (s *BranchesService) UnprotectBranch(pid interface{}, branch string, options ...OptionFunc) (*Branch, *Response, error)

UnprotectBranch unprotects a single project repository branch. This is an idempotent function, unprotecting an already unprotected repository branch still returns a 200 OK status code.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#unprotect-repository-branch

type Build

type Build struct {
	Commit        *Commit    `json:"commit"`
	CreatedAt     *time.Time `json:"created_at"`
	ArtifactsFile struct {
		Filename string `json:"filename"`
		Size     int    `json:"size"`
	} `json:"artifacts_file"`
	FinishedAt *time.Time `json:"finished_at"`
	ID         int        `json:"id"`
	Name       string     `json:"name"`
	Ref        string     `json:"ref"`
	Runner     struct {
		ID          int    `json:"id"`
		Description string `json:"description"`
		Active      bool   `json:"active"`
		IsShared    bool   `json:"is_shared"`
		Name        string `json:"name"`
	} `json:"runner"`
	Stage     string     `json:"stage"`
	StartedAt *time.Time `json:"started_at"`
	Status    string     `json:"status"`
	Tag       bool       `json:"tag"`
	User      *User      `json:"user"`
}

Build represents a ci build.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md

type BuildEvent

type BuildEvent struct {
	ObjectKind        string `json:"object_kind"`
	Ref               string `json:"ref"`
	Tag               bool   `json:"tag"`
	BeforeSha         string `json:"before_sha"`
	Sha               string `json:"sha"`
	BuildID           int    `json:"build_id"`
	BuildName         string `json:"build_name"`
	BuildStage        string `json:"build_stage"`
	BuildStatus       string `json:"build_status"`
	BuildStartedAt    string `json:"build_started_at"`
	BuildFinishedAt   string `json:"build_finished_at"`
	BuildDuration     string `json:"build_duration"`
	BuildAllowFailure bool   `json:"build_allow_failure"`
	ProjectID         int    `json:"project_id"`
	ProjectName       string `json:"project_name"`
	User              struct {
		ID    int    `json:"id"`
		Name  string `json:"name"`
		Email string `json:"email"`
	} `json:"user"`
	Commit struct {
		ID          int    `json:"id"`
		Sha         string `json:"sha"`
		Message     string `json:"message"`
		AuthorName  string `json:"author_name"`
		AuthorEmail string `json:"author_email"`
		Status      string `json:"status"`
		Duration    string `json:"duration"`
		StartedAt   string `json:"started_at"`
		FinishedAt  string `json:"finished_at"`
	} `json:"commit"`
	Repository *Repository `json:"repository"`
}

BuildEvent represents a build event

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#build-events

type BuildState

type BuildState string

BuildState represents a GitLab build state.

const (
	Pending  BuildState = "pending"
	Running  BuildState = "running"
	Success  BuildState = "success"
	Failed   BuildState = "failed"
	Canceled BuildState = "canceled"
)

These constants represent all valid build states.

type BuildTrigger

type BuildTrigger struct {
	CreatedAt *time.Time `json:"created_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	LastUsed  *time.Time `json:"last_used"`
	Token     string     `json:"token"`
	UpdatedAt *time.Time `json:"updated_at"`
}

BuildTrigger represents a project build trigger.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_triggers.md#build-triggers

type BuildVariable

type BuildVariable struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

BuildVariable represents a variable available for each build of the given project

Gitlab API Docs : https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md

func (BuildVariable) String

func (v BuildVariable) String() string

type BuildVariablesService

type BuildVariablesService struct {
	// contains filtered or unexported fields
}

BuildVariablesService handles communication with the project variables related methods of the Gitlab API

Gitlab API Docs : https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md

func (*BuildVariablesService) CreateBuildVariable

func (s *BuildVariablesService) CreateBuildVariable(pid interface{}, key, value string, options ...OptionFunc) (*BuildVariable, *Response, error)

CreateBuildVariable creates a variable for a given project

Gitlab API Docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md#create-variable

func (*BuildVariablesService) GetBuildVariable

func (s *BuildVariablesService) GetBuildVariable(pid interface{}, key string, options ...OptionFunc) (*BuildVariable, *Response, error)

GetBuildVariable gets a single project variable of a project

Gitlab API Docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md#show-variable-details

func (*BuildVariablesService) ListBuildVariables

func (s *BuildVariablesService) ListBuildVariables(pid interface{}, opts *ListBuildVariablesOptions, options ...OptionFunc) ([]*BuildVariable, *Response, error)

ListBuildVariables gets the a list of project variables in a project

Gitlab API Docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md#list-project-variables

func (*BuildVariablesService) RemoveBuildVariable

func (s *BuildVariablesService) RemoveBuildVariable(pid interface{}, key string, options ...OptionFunc) (*Response, error)

RemoveBuildVariable removes a project variable of a given project identified by its key

Gitlab API Docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md#remove-variable

func (*BuildVariablesService) UpdateBuildVariable

func (s *BuildVariablesService) UpdateBuildVariable(pid interface{}, key, value string, options ...OptionFunc) (*BuildVariable, *Response, error)

UpdateBuildVariable updates an existing project variable The variable key must exist

Gitlab API Docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md#update-variable

type BuildsService

type BuildsService struct {
	// contains filtered or unexported fields
}

BuildsService handles communication with the ci builds related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md

func (*BuildsService) CancelBuild

func (s *BuildsService) CancelBuild(pid interface{}, buildID int, options ...OptionFunc) (*Build, *Response, error)

CancelBuild cancels a single build of a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#cancel-a-build

func (*BuildsService) DownloadArtifactsFile

func (s *BuildsService) DownloadArtifactsFile(pid interface{}, refName string, job string, options ...OptionFunc) (io.Reader, *Response, error)

DownloadArtifactsFile download the artifacts file from the given reference name and job provided the build finished successfully.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#download-the-artifacts-file

func (*BuildsService) EraseBuild

func (s *BuildsService) EraseBuild(pid interface{}, buildID int, options ...OptionFunc) (*Build, *Response, error)

EraseBuild erases a single build of a project, removes a build artifacts and a build trace.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#erase-a-build

func (*BuildsService) GetBuild

func (s *BuildsService) GetBuild(pid interface{}, buildID int, options ...OptionFunc) (*Build, *Response, error)

GetBuild gets a single build of a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#get-a-single-build

func (*BuildsService) GetBuildArtifacts

func (s *BuildsService) GetBuildArtifacts(pid interface{}, buildID int, options ...OptionFunc) (io.Reader, *Response, error)

GetBuildArtifacts get builds artifacts of a project

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#get-build-artifacts

func (*BuildsService) GetTraceFile

func (s *BuildsService) GetTraceFile(pid interface{}, buildID int, options ...OptionFunc) (io.Reader, *Response, error)

GetTraceFile gets a trace of a specific build of a project

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#get-a-trace-file

func (*BuildsService) KeepArtifacts

func (s *BuildsService) KeepArtifacts(pid interface{}, buildID int, options ...OptionFunc) (*Build, *Response, error)

KeepArtifacts prevents artifacts from being deleted when expiration is set.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#keep-artifacts

func (*BuildsService) ListCommitBuilds

func (s *BuildsService) ListCommitBuilds(pid interface{}, sha string, opts *ListBuildsOptions, options ...OptionFunc) ([]Build, *Response, error)

ListCommitBuilds gets a list of builds for specific commit in a project. If the commit SHA is not found, it will respond with 404.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#list-commit-builds

func (*BuildsService) ListProjectBuilds

func (s *BuildsService) ListProjectBuilds(pid interface{}, opts *ListBuildsOptions, options ...OptionFunc) ([]Build, *Response, error)

ListProjectBuilds gets a list of builds in a project.

The scope of builds to show, one or array of: pending, running, failed, success, canceled; showing all builds if none provided.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#list-project-builds

func (*BuildsService) PlayBuild

func (s *BuildsService) PlayBuild(pid interface{}, buildID int, options ...OptionFunc) (*Build, *Response, error)

PlayBuild triggers a nanual action to start a build.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#play-a-build

func (*BuildsService) RetryBuild

func (s *BuildsService) RetryBuild(pid interface{}, buildID int, options ...OptionFunc) (*Build, *Response, error)

RetryBuild retries a single build of a project

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/builds.md#retry-a-build

type CherryPickCommitOptions

type CherryPickCommitOptions struct {
	TargetBranch *string `url:"branch" json:"branch,omitempty"`
}

CherryPickCommitOptions represents the available options for cherry-picking a commit.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#cherry-pick-a-commit

type Client

type Client struct {

	// User agent used when communicating with the GitLab API.
	UserAgent string

	// Services used for talking to different parts of the GitLab API.
	Branches             *BranchesService
	BuildVariables       *BuildVariablesService
	Builds               *BuildsService
	Commits              *CommitsService
	DeployKeys           *DeployKeysService
	Groups               *GroupsService
	Issues               *IssuesService
	Labels               *LabelsService
	MergeRequests        *MergeRequestsService
	Milestones           *MilestonesService
	Namespaces           *NamespacesService
	Notes                *NotesService
	NotificationSettings *NotificationSettingsService
	Projects             *ProjectsService
	ProjectSnippets      *ProjectSnippetsService
	Pipelines            *PipelinesService
	Repositories         *RepositoriesService
	RepositoryFiles      *RepositoryFilesService
	Services             *ServicesService
	Session              *SessionService
	Settings             *SettingsService
	SystemHooks          *SystemHooksService
	Tags                 *TagsService
	TimeStats            *TimeStatsService
	Users                *UsersService
	Version              *VersionService
	// contains filtered or unexported fields
}

A Client manages communication with the GitLab API.

func NewClient

func NewClient(httpClient *http.Client, token string) *Client

NewClient returns a new GitLab API client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide a valid private token.

func NewOAuthClient

func NewOAuthClient(httpClient *http.Client, token string) *Client

NewOAuthClient returns a new GitLab API client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide a valid oauth token.

func (*Client) BaseURL

func (c *Client) BaseURL() *url.URL

BaseURL return a copy of the baseURL.

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, opt interface{}, options []OptionFunc) (*http.Request, error)

NewRequest creates an API request. A relative URL path can be provided in urlStr, in which case it is resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(urlStr string) error

SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.

type Commit

type Commit struct {
	ID             string       `json:"id"`
	ShortID        string       `json:"short_id"`
	Title          string       `json:"title"`
	AuthorName     string       `json:"author_name"`
	AuthorEmail    string       `json:"author_email"`
	AuthoredDate   *time.Time   `json:"authored_date"`
	CommitterName  string       `json:"committer_name"`
	CommitterEmail string       `json:"committer_email"`
	CommittedDate  *time.Time   `json:"committed_date"`
	CreatedAt      *time.Time   `json:"created_at"`
	Message        string       `json:"message"`
	ParentIDs      []string     `json:"parent_ids"`
	Stats          *CommitStats `json:"stats"`
	Status         *BuildState  `json:"status"`
}

Commit represents a GitLab commit.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md

func (Commit) String

func (c Commit) String() string

type CommitAction

type CommitAction struct {
	Action       FileAction `url:"action" json:"action,omitempty"`
	FilePath     string     `url:"file_path" json:"file_path,omitempty"`
	PreviousPath string     `url:"previous_path,omitempty" json:"previous_path,omitempty"`
	Content      string     `url:"content,omitempty" json:"content,omitempty"`
	Encoding     string     `url:"encoding,omitempty" json:"encoding,omitempty"`
}

CommitAction represents a single file action within a commit.

type CommitComment

type CommitComment struct {
	Note     string `json:"note"`
	Path     string `json:"path"`
	Line     int    `json:"line"`
	LineType string `json:"line_type"`
	Author   Author `json:"author"`
}

CommitComment represents a GitLab commit comment.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md

func (CommitComment) String

func (c CommitComment) String() string

type CommitCommentEvent

type CommitCommentEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	ProjectID  int    `json:"project_id"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository       *Repository `json:"repository"`
	ObjectAttributes struct {
		ID           int    `json:"id"`
		Note         string `json:"note"`
		NoteableType string `json:"noteable_type"`
		AuthorID     int    `json:"author_id"`
		CreatedAt    string `json:"created_at"`
		UpdatedAt    string `json:"updated_at"`
		ProjectID    int    `json:"project_id"`
		Attachment   string `json:"attachment"`
		LineCode     string `json:"line_code"`
		CommitID     string `json:"commit_id"`
		NoteableID   int    `json:"noteable_id"`
		System       bool   `json:"system"`
		StDiff       struct {
			Diff        string `json:"diff"`
			NewPath     string `json:"new_path"`
			OldPath     string `json:"old_path"`
			AMode       string `json:"a_mode"`
			BMode       string `json:"b_mode"`
			NewFile     bool   `json:"new_file"`
			RenamedFile bool   `json:"renamed_file"`
			DeletedFile bool   `json:"deleted_file"`
		} `json:"st_diff"`
	} `json:"object_attributes"`
	Commit *Commit `json:"commit"`
}

CommitCommentEvent represents a comment on a commit event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#comment-on-commit

type CommitStats

type CommitStats struct {
	Additions int `json:"additions"`
	Deletions int `json:"deletions"`
	Total     int `json:"total"`
}

CommitStats represents the number of added and deleted files in a commit.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md

type CommitStatus

type CommitStatus struct {
	ID          int        `json:"id"`
	SHA         string     `json:"sha"`
	Ref         string     `json:"ref"`
	Status      string     `json:"status"`
	Name        string     `json:"name"`
	TargetURL   string     `json:"target_url"`
	Description string     `json:"description"`
	CreatedAt   *time.Time `json:"created_at"`
	StartedAt   *time.Time `json:"started_at"`
	FinishedAt  *time.Time `json:"finished_at"`
	Author      Author     `json:"author"`
}

CommitStatus represents a GitLab commit status.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#get-the-status-of-a-commit

type CommitsService

type CommitsService struct {
	// contains filtered or unexported fields
}

CommitsService handles communication with the commit related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md

func (*CommitsService) CherryPickCommit

func (s *CommitsService) CherryPickCommit(pid interface{}, sha string, opt *CherryPickCommitOptions, options ...OptionFunc) (*Commit, *Response, error)

CherryPickCommit sherry picks a commit to a given branch.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#cherry-pick-a-commit

func (*CommitsService) CreateCommit

func (s *CommitsService) CreateCommit(pid interface{}, opt *CreateCommitOptions, options ...OptionFunc) (*Commit, *Response, error)

CreateCommit creates a commit with multiple files and actions.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#create-a-commit-with-multiple-files-and-actions

func (*CommitsService) GetCommit

func (s *CommitsService) GetCommit(pid interface{}, sha string, options ...OptionFunc) (*Commit, *Response, error)

GetCommit gets a specific commit identified by the commit hash or name of a branch or tag.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#get-a-single-commit

func (*CommitsService) GetCommitComments

func (s *CommitsService) GetCommitComments(pid interface{}, sha string, options ...OptionFunc) ([]*CommitComment, *Response, error)

GetCommitComments gets the comments of a commit in a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#get-the-comments-of-a-commit

func (*CommitsService) GetCommitDiff

func (s *CommitsService) GetCommitDiff(pid interface{}, sha string, options ...OptionFunc) ([]*Diff, *Response, error)

GetCommitDiff gets the diff of a commit in a project..

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#get-the-diff-of-a-commit

func (*CommitsService) GetCommitStatuses

func (s *CommitsService) GetCommitStatuses(pid interface{}, sha string, opt *GetCommitStatusesOptions, options ...OptionFunc) ([]*CommitStatus, *Response, error)

GetCommitStatuses gets the statuses of a commit in a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#get-the-status-of-a-commit

func (*CommitsService) ListCommits

func (s *CommitsService) ListCommits(pid interface{}, opt *ListCommitsOptions, options ...OptionFunc) ([]*Commit, *Response, error)

ListCommits gets a list of repository commits in a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#list-commits

func (*CommitsService) PostCommitComment

func (s *CommitsService) PostCommitComment(pid interface{}, sha string, opt *PostCommitCommentOptions, options ...OptionFunc) (*CommitComment, *Response, error)

PostCommitComment adds a comment to a commit. Optionally you can post comments on a specific line of a commit. Therefor both path, line_new and line_old are required.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#post-comment-to-commit

func (*CommitsService) SetCommitStatus

func (s *CommitsService) SetCommitStatus(pid interface{}, sha string, opt *SetCommitStatusOptions, options ...OptionFunc) (*CommitStatus, *Response, error)

SetCommitStatus sets the status of a commit in a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#post-the-status-to-commit

type Compare

type Compare struct {
	Commit         *Commit   `json:"commit"`
	Commits        []*Commit `json:"commits"`
	Diffs          []*Diff   `json:"diffs"`
	CompareTimeout bool      `json:"compare_timeout"`
	CompareSameRef bool      `json:"compare_same_ref"`
}

Compare represents the result of a comparison of branches, tags or commits.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#compare-branches-tags-or-commits

func (Compare) String

func (c Compare) String() string

type CompareOptions

type CompareOptions struct {
	From *string `url:"from,omitempty" json:"from,omitempty"`
	To   *string `url:"to,omitempty" json:"to,omitempty"`
}

CompareOptions represents the available Compare() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#compare-branches-tags-or-commits

type Contributor

type Contributor struct {
	Name      string `json:"name,omitempty"`
	Email     string `json:"email,omitempty"`
	Commits   int    `json:"commits,omitempty"`
	Additions int    `json:"additions,omitempty"`
	Deletions int    `json:"deletions,omitempty"`
}

Contributor represents a GitLap contributor.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#contributer

func (Contributor) String

func (c Contributor) String() string

type CreateBranchOptions

type CreateBranchOptions struct {
	BranchName *string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
	Ref        *string `url:"ref,omitempty" json:"ref,omitempty"`
}

CreateBranchOptions represents the available CreateBranch() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#create-repository-branch

type CreateCommitOptions

type CreateCommitOptions struct {
	BranchName    *string         `url:"branch_name" json:"branch_name,omitempty"`
	CommitMessage *string         `url:"commit_message" json:"commit_message,omitempty"`
	Actions       []*CommitAction `url:"actions" json:"actions,omitempty"`
	AuthorEmail   *string         `url:"author_email,omitempty" json:"author_email,omitempty"`
	AuthorName    *string         `url:"author_name,omitempty" json:"author_name,omitempty"`
}

CreateCommitOptions represents the available options for a new commit.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#create-a-commit-with-multiple-files-and-actions

type CreateFileOptions

type CreateFileOptions struct {
	FilePath      *string `url:"file_path,omitempty" json:"file_path,omitempty"`
	BranchName    *string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
	Encoding      *string `url:"encoding,omitempty" json:"encoding,omitempty"`
	AuthorEmail   *string `url:"author_email,omitempty" json:"author_email,omitempty"`
	AuthorName    *string `url:"author_name,omitempty" json:"author_name,omitempty"`
	Content       *string `url:"content,omitempty" json:"content,omitempty"`
	CommitMessage *string `url:"commit_message,omitempty" json:"commit_message,omitempty"`
}

CreateFileOptions represents the available CreateFile() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#create-new-file-in-repository

type CreateGroupOptions

type CreateGroupOptions struct {
	Name                 *string               `url:"name,omitempty" json:"name,omitempty"`
	Path                 *string               `url:"path,omitempty" json:"path,omitempty"`
	Description          *string               `url:"description,omitempty" json:"description,omitempty"`
	LFSEnabled           *bool                 `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
	RequestAccessEnabled *bool                 `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
	VisibilityLevel      *VisibilityLevelValue `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
}

CreateGroupOptions represents the available CreateGroup() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#new-group

type CreateIssueNoteOptions

type CreateIssueNoteOptions struct {
	Body *string `url:"body,omitempty" json:"body,omitempty"`
}

CreateIssueNoteOptions represents the available CreateIssueNote() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#create-new-issue-note

type CreateIssueOptions

type CreateIssueOptions struct {
	Title       *string `url:"title,omitempty" json:"title,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
	AssigneeID  *int    `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	MilestoneID *int    `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
	Labels      Labels  `url:"labels,comma,omitempty" json:"labels,omitempty"`
}

CreateIssueOptions represents the available CreateIssue() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#new-issues

type CreateLabelOptions

type CreateLabelOptions struct {
	Name        *string `url:"name,omitempty" json:"name,omitempty"`
	Color       *string `url:"color,omitempty" json:"color,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
}

CreateLabelOptions represents the available CreateLabel() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#create-a-new-label

type CreateMergeRequestNoteOptions

type CreateMergeRequestNoteOptions struct {
	Body *string `url:"body,omitempty" json:"body,omitempty"`
}

CreateMergeRequestNoteOptions represents the available CreateMergeRequestNote() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#create-new-merge-request-note

type CreateMergeRequestOptions

type CreateMergeRequestOptions struct {
	Title           *string `url:"title,omitempty" json:"title,omitempty"`
	Description     *string `url:"description,omitempty" json:"description,omitempty"`
	SourceBranch    *string `url:"source_branch,omitemtpy" json:"source_branch,omitemtpy"`
	TargetBranch    *string `url:"target_branch,omitemtpy" json:"target_branch,omitemtpy"`
	AssigneeID      *int    `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	TargetProjectID *int    `url:"target_project_id,omitempty" json:"target_project_id,omitempty"`
}

CreateMergeRequestOptions represents the available CreateMergeRequest() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#create-mr

type CreateMilestoneOptions

type CreateMilestoneOptions struct {
	Title       *string `url:"title,omitempty" json:"title,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
	StartDate   *string `url:"start_date,omitempty" json:"start_date,omitempty"`
	DueDate     *string `url:"due_date,omitempty" json:"due_date,omitempty"`
}

CreateMilestoneOptions represents the available CreateMilestone() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#create-new-milestone

type CreatePipelineOptions

type CreatePipelineOptions struct {
	Ref *string `url:"ref,omitempty" json:"ref"`
}

CreatePipelineOptions represents the available CreatePipeline() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md#create-a-new-pipeline

type CreateProjectForUserOptions

type CreateProjectForUserOptions CreateProjectOptions

CreateProjectForUserOptions represents the available CreateProjectForUser() options; these are identical to those for an ordinary Project, since the required "user_id" parameter is provided in the request URL.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#create-project-for-user

type CreateProjectOptions

type CreateProjectOptions struct {
	Name                                      *string               `url:"name,omitempty" json:"name,omitempty"`
	Path                                      *string               `url:"path,omitempty" json:"path,omitempty"`
	DefaultBranch                             *string               `url:"default_branch,omitempty" json:"default_branch,omitempty"` // note: this does not work
	NamespaceID                               *int                  `url:"namespace_id,omitempty" json:"namespace_id,omitempty"`
	Description                               *string               `url:"description,omitempty" json:"description,omitempty"`
	IssuesEnabled                             *bool                 `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"`
	MergeRequestsEnabled                      *bool                 `url:"merge_requests_enabled,omitempty" json:"merge_requests_enabled,omitempty"`
	BuildsEnabled                             *bool                 `url:"builds_enabled,omitempty" json:"builds_enabled,omitempty"`
	WikiEnabled                               *bool                 `url:"wiki_enabled,omitempty" json:"wiki_enabled,omitempty"`
	SnippetsEnabled                           *bool                 `url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"`
	ContainerRegistryEnabled                  *bool                 `url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"`
	SharedRunnersEnabled                      *bool                 `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
	Public                                    *bool                 `url:"public,omitempty" json:"public,omitempty"`
	VisibilityLevel                           *VisibilityLevelValue `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
	ImportURL                                 *string               `url:"import_url,omitempty" json:"import_url,omitempty"`
	PublicBuilds                              *bool                 `url:"public_builds,omitempty" json:"public_builds,omitempty"`
	OnlyAllowMergeIfBuildSucceeds             *bool                 `url:"only_allow_merge_if_build_succeeds,omitempty" json:"only_allow_merge_if_build_succeeds,omitempty"`
	OnlyAllowMergeIfAllDiscussionsAreResolved *bool                 `` /* 130-byte string literal not displayed */
	LFSEnabled                                *bool                 `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
	RequestAccessEnabled                      *bool                 `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
}

CreateProjectOptions represents the available CreateProjects() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#create-project

type CreateSnippetNoteOptions

type CreateSnippetNoteOptions struct {
	Body *string `url:"body,omitempty" json:"body,omitempty"`
}

CreateSnippetNoteOptions represents the available CreateSnippetNote() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#create-new-snippet-note

type CreateSnippetOptions

type CreateSnippetOptions struct {
	Title           *string               `url:"title,omitempty" json:"title,omitempty"`
	FileName        *string               `url:"file_name,omitempty" json:"file_name,omitempty"`
	Code            *string               `url:"code,omitempty" json:"code,omitempty"`
	VisibilityLevel *VisibilityLevelValue `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
}

CreateSnippetOptions represents the available CreateSnippet() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#create-new-snippet

type CreateTagOptions

type CreateTagOptions struct {
	TagName            *string `url:"tag_name,omitempty" json:"tag_name,omitempty"`
	Ref                *string `url:"ref,omitempty" json:"ref,omitempty"`
	Message            *string `url:"message,omitempty" json:"message,omitempty"`
	ReleaseDescription *string `url:"release_description:omitempty" json:"release_description,omitempty"`
}

CreateTagOptions represents the available CreateTag() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md#create-a-new-tag

type CreateUserOptions

type CreateUserOptions struct {
	Email          *string `url:"email,omitempty" json:"email,omitempty"`
	Password       *string `url:"password,omitempty" json:"password,omitempty"`
	Username       *string `url:"username,omitempty" json:"username,omitempty"`
	Name           *string `url:"name,omitempty" json:"name,omitempty"`
	Skype          *string `url:"skype,omitempty" json:"skype,omitempty"`
	Linkedin       *string `url:"linkedin,omitempty" json:"linkedin,omitempty"`
	Twitter        *string `url:"twitter,omitempty" json:"twitter,omitempty"`
	WebsiteURL     *string `url:"website_url,omitempty" json:"website_url,omitempty"`
	ProjectsLimit  *int    `url:"projects_limit,omitempty" json:"projects_limit,omitempty"`
	ExternUID      *string `url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
	Provider       *string `url:"provider,omitempty" json:"provider,omitempty"`
	Bio            *string `url:"bio,omitempty" json:"bio,omitempty"`
	Admin          *bool   `url:"admin,omitempty" json:"admin,omitempty"`
	CanCreateGroup *bool   `url:"can_create_group,omitempty" json:"can_create_group,omitempty"`
	Confirm        *bool   `url:"confirm,omitempty" json:"confirm,omitempty"`
}

CreateUserOptions represents the available CreateUser() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#user-creation

type DeleteFileOptions

type DeleteFileOptions struct {
	FilePath      *string `url:"file_path,omitempty" json:"file_path,omitempty"`
	BranchName    *string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
	AuthorEmail   *string `url:"author_email,omitempty" json:"author_email,omitempty"`
	AuthorName    *string `url:"author_name,omitempty" json:"author_name,omitempty"`
	CommitMessage *string `url:"commit_message,omitempty" json:"commit_message,omitempty"`
}

DeleteFileOptions represents the available DeleteFile() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#delete-existing-file-in-repository

type DeleteLabelOptions

type DeleteLabelOptions struct {
	Name *string `url:"name,omitempty" json:"name,omitempty"`
}

DeleteLabelOptions represents the available DeleteLabel() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#delete-a-label

type DeployKey

type DeployKey struct {
	ID        int        `json:"id"`
	Title     string     `json:"title"`
	Key       string     `json:"key"`
	CanPush   *bool      `json:"can_push"`
	CreatedAt *time.Time `json:"created_at"`
}

DeployKey represents a GitLab deploy key.

func (DeployKey) String

func (k DeployKey) String() string

type DeployKeysService

type DeployKeysService struct {
	// contains filtered or unexported fields
}

DeployKeysService handles communication with the keys related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/deploy_keys.md

func (*DeployKeysService) AddDeployKey

func (s *DeployKeysService) AddDeployKey(pid interface{}, opt *AddDeployKeyOptions, options ...OptionFunc) (*DeployKey, *Response, error)

AddDeployKey creates a new deploy key for a project. If deploy key already exists in another project - it will be joined to project but only if original one was is accessible by same user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/deploy_keys.md#add-deploy-key

func (*DeployKeysService) DeleteDeployKey

func (s *DeployKeysService) DeleteDeployKey(pid interface{}, deployKey int, options ...OptionFunc) (*Response, error)

DeleteDeployKey deletes a deploy key from a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/deploy_keys.md#delete-deploy-key

func (*DeployKeysService) GetDeployKey

func (s *DeployKeysService) GetDeployKey(pid interface{}, deployKey int, options ...OptionFunc) (*DeployKey, *Response, error)

GetDeployKey gets a single deploy key.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/deploy_keys.md#single-deploy-key

func (*DeployKeysService) ListDeployKeys

func (s *DeployKeysService) ListDeployKeys(pid interface{}, options ...OptionFunc) ([]*DeployKey, *Response, error)

ListDeployKeys gets a list of a project's deploy keys

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/deploy_keys.md#list-deploy-keys

type Diff

type Diff struct {
	Diff        string `json:"diff"`
	NewPath     string `json:"new_path"`
	OldPath     string `json:"old_path"`
	AMode       string `json:"a_mode"`
	BMode       string `json:"b_mode"`
	NewFile     bool   `json:"new_file"`
	RenamedFile bool   `json:"renamed_file"`
	DeletedFile bool   `json:"deleted_file"`
}

Diff represents a GitLab diff.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md

func (Diff) String

func (d Diff) String() string

type DroneCIService

type DroneCIService struct {
	Service
	Properties *DroneCIServiceProperties `json:"properties"`
}

DroneCIService represents Drone CI service settings.

type DroneCIServiceProperties

type DroneCIServiceProperties struct {
	Token                 *string `url:"token" json:"token"`
	DroneURL              *string `url:"drone_url" json:"drone_url"`
	EnableSSLVerification *string `url:"enable_ssl_verification" json:"enable_ssl_verification"`
}

DroneCIServiceProperties represents Drone CI specific properties.

type EditProjectHookOptions

type EditProjectHookOptions struct {
	URL                   *string `url:"url,omitempty" json:"url,omitempty"`
	PushEvents            *bool   `url:"push_events,omitempty" json:"push_events,omitempty"`
	IssuesEvents          *bool   `url:"issues_events,omitempty" json:"issues_events,omitempty"`
	MergeRequestsEvents   *bool   `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
	TagPushEvents         *bool   `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
	NoteEvents            *bool   `url:"note_events,omitempty" json:"note_events,omitempty"`
	BuildEvents           *bool   `url:"build_events,omitempty" json:"build_events,omitempty"`
	PipelineEvents        *bool   `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
	WikiPageEvents        *bool   `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
	EnableSSLVerification *bool   `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
	Token                 *string `url:"token,omitempty" json:"token,omitempty"`
}

EditProjectHookOptions represents the available EditProjectHook() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#edit-project-hook

type EditProjectMemberOptions

type EditProjectMemberOptions struct {
	AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
}

EditProjectMemberOptions represents the available EditProjectMember() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#edit-project-team-member

type EditProjectOptions

type EditProjectOptions struct {
	Name                                      *string               `url:"name,omitempty" json:"name,omitempty"`
	Path                                      *string               `url:"path,omitempty" json:"path,omitempty"`
	Description                               *string               `url:"description,omitempty" json:"description,omitempty"`
	DefaultBranch                             *string               `url:"default_branch,omitempty" json:"default_branch,omitempty"`
	IssuesEnabled                             *bool                 `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"`
	MergeRequestsEnabled                      *bool                 `url:"merge_requests_enabled,omitempty" json:"merge_requests_enabled,omitempty"`
	ApprovalsBeforeMerge                      *int                  `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"`
	BuildsEnabled                             *bool                 `url:"builds_enabled,omitempty" json:"builds_enabled,omitempty"`
	WikiEnabled                               *bool                 `url:"wiki_enabled,omitempty" json:"wiki_enabled,omitempty"`
	SnippetsEnabled                           *bool                 `url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"`
	ContainerRegistryEnabled                  *bool                 `url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"`
	SharedRunnersEnabled                      *bool                 `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
	Public                                    *bool                 `url:"public,omitempty" json:"public,omitempty"`
	VisibilityLevel                           *VisibilityLevelValue `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
	ImportURL                                 *bool                 `url:"import_url,omitempty" json:"import_url,omitempty"`
	PublicBuilds                              *bool                 `url:"public_builds,omitempty" json:"public_builds,omitempty"`
	OnlyAllowMergeIfBuildSucceeds             *bool                 `url:"only_allow_merge_if_build_succeeds,omitempty" json:"only_allow_merge_if_build_succeeds,omitempty"`
	OnlyAllowMergeIfAllDiscussionsAreResolved *bool                 `` /* 130-byte string literal not displayed */
	LFSEnabled                                *bool                 `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
	RequestAccessEnabled                      *bool                 `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
}

EditProjectOptions represents the available EditProject() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#edit-project

type Email

type Email struct {
	ID    int    `json:"id"`
	Email string `json:"email"`
}

Email represents an Email.

GitLab API docs: https://doc.gitlab.com/ce/api/users.html#list-emails

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response
	Message  string
}

An ErrorResponse reports one or more errors caused by an API request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/README.md#data-validation-and-error-reporting

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type File

type File struct {
	FileName string `json:"file_name"`
	FilePath string `json:"file_path"`
	Size     int    `json:"size"`
	Encoding string `json:"encoding"`
	Content  string `json:"content"`
	Ref      string `json:"ref"`
	BlobID   string `json:"blob_id"`
	CommitID string `json:"commit_id"`
}

File represents a GitLab repository file.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md

func (File) String

func (r File) String() string

type FileAction

type FileAction string

FileAction represents the available actions that can be performed on a file.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#create-a-commit-with-multiple-files-and-actions

const (
	FileCreate FileAction = "create"
	FileDelete FileAction = "delete"
	FileMove   FileAction = "move"
	FileUpdate FileAction = "update"
)

The available file actions.

type FileInfo

type FileInfo struct {
	FilePath   string `json:"file_path"`
	BranchName string `json:"branch_name"`
}

FileInfo represents file details of a GitLab repository file.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md

func (FileInfo) String

func (r FileInfo) String() string

type ForkParent

type ForkParent struct {
	HTTPURLToRepo     string `json:"http_url_to_repo"`
	ID                int    `json:"id"`
	Name              string `json:"name"`
	NameWithNamespace string `json:"name_with_namespace"`
	Path              string `json:"path"`
	PathWithNamespace string `json:"path_with_namespace"`
	WebURL            string `json:"web_url"`
}

ForkParent represents the parent project when this is a fork.

type GetCommitStatusesOptions

type GetCommitStatusesOptions struct {
	Ref   *string `url:"ref,omitempty" json:"ref,omitempty"`
	Stage *string `url:"stage,omitempty" json:"stage,omitempty"`
	Name  *string `url:"name,omitempty" json:"name,omitempty"`
	All   *bool   `url:"all,omitempty" json:"all,omitempty"`
}

GetCommitStatusesOptions represents the available GetCommitStatuses() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#get-the-status-of-a-commit

type GetFileOptions

type GetFileOptions struct {
	FilePath *string `url:"file_path,omitempty" json:"file_path,omitempty"`
	Ref      *string `url:"ref,omitempty" json:"ref,omitempty"`
}

GetFileOptions represents the available GetFile() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#get-file-from-respository

type GetMilestoneIssuesOptions

type GetMilestoneIssuesOptions struct {
	ListOptions
}

GetMilestoneIssuesOptions represents the available GetMilestoneIssues() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#get-all-issues-assigned-to-a-single-milestone

type GetProjectEventsOptions

type GetProjectEventsOptions struct {
	ListOptions
}

GetProjectEventsOptions represents the available GetProjectEvents() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#get-project-events

type GetSessionOptions

type GetSessionOptions struct {
	Login    *string `url:"login,omitempty" json:"login,omitempty"`
	Email    *string `url:"email,omitempty" json:"email,omitempty"`
	Password *string `url:"password,omitempty" json:"password,omitempty"`
}

GetSessionOptions represents the available Session() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/session.md#session

type Group

type Group struct {
	ID                   int                  `json:"id"`
	Name                 string               `json:"name"`
	Path                 string               `json:"path"`
	Description          string               `json:"description"`
	AvatarURL            string               `json:"avatar_url"`
	LFSEnabled           bool                 `json:"lfs_enabled"`
	Projects             []*Project           `json:"projects"`
	Statistics           *StorageStatistics   `json:"statistics"`
	RequestAccessEnabled bool                 `json:"request_access_enabled"`
	VisibilityLevel      VisibilityLevelValue `json:"visibility_level"`
	WebURL               string               `json:"web_url"`
}

Group represents a GitLab group.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md

type GroupAccess

type GroupAccess struct {
	AccessLevel       AccessLevelValue       `json:"access_level"`
	NotificationLevel NotificationLevelValue `json:"notification_level"`
}

GroupAccess represents group access.

type GroupMember

type GroupMember struct {
	ID          int              `json:"id"`
	Username    string           `json:"username"`
	Email       string           `json:"email"`
	Name        string           `json:"name"`
	State       string           `json:"state"`
	CreatedAt   *time.Time       `json:"created_at"`
	AccessLevel AccessLevelValue `json:"access_level"`
}

GroupMember represents a GitLab group member.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md

type GroupsService

type GroupsService struct {
	// contains filtered or unexported fields
}

GroupsService handles communication with the group related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md

func (*GroupsService) AddGroupMember

func (s *GroupsService) AddGroupMember(gid interface{}, opt *AddGroupMemberOptions, options ...OptionFunc) (*GroupMember, *Response, error)

AddGroupMember adds a user to the list of group members.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-group-members

func (*GroupsService) CreateGroup

func (s *GroupsService) CreateGroup(opt *CreateGroupOptions, options ...OptionFunc) (*Group, *Response, error)

CreateGroup creates a new project group. Available only for users who can create groups.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#new-group

func (*GroupsService) DeleteGroup

func (s *GroupsService) DeleteGroup(gid interface{}, options ...OptionFunc) (*Response, error)

DeleteGroup removes group with all projects inside.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#remove-group

func (*GroupsService) GetGroup

func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group, *Response, error)

GetGroup gets all details of a group.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#details-of-a-group

func (*GroupsService) ListGroupMembers

func (s *GroupsService) ListGroupMembers(gid interface{}, opt *ListGroupMembersOptions, options ...OptionFunc) ([]*GroupMember, *Response, error)

ListGroupMembers get a list of group members viewable by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-group-members

func (*GroupsService) ListGroupProjects

func (s *GroupsService) ListGroupProjects(gid interface{}, opt *ListGroupProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

ListGroupProjects get a list of group projects

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-a-group-s-projects

func (*GroupsService) ListGroups

func (s *GroupsService) ListGroups(opt *ListGroupsOptions, options ...OptionFunc) ([]*Group, *Response, error)

ListGroups gets a list of groups. (As user: my groups, as admin: all groups)

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-project-groups

func (*GroupsService) RemoveGroupMember

func (s *GroupsService) RemoveGroupMember(gid interface{}, user int, options ...OptionFunc) (*Response, error)

RemoveGroupMember removes user from user team.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#remove-user-from-user-team

func (*GroupsService) SearchGroup

func (s *GroupsService) SearchGroup(query string, options ...OptionFunc) ([]*Group, *Response, error)

SearchGroup get all groups that match your string in their name or path.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#search-for-group

func (*GroupsService) TransferGroup

func (s *GroupsService) TransferGroup(gid interface{}, project int, options ...OptionFunc) (*Group, *Response, error)

TransferGroup transfers a project to the Group namespace. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#transfer-project-to-group

func (*GroupsService) UpdateGroup

func (s *GroupsService) UpdateGroup(gid interface{}, opt *UpdateGroupOptions, options ...OptionFunc) (*Group, *Response, error)

UpdateGroup updates an existing group; only available to group owners and administrators.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#update-group

func (*GroupsService) UpdateGroupMember

func (s *GroupsService) UpdateGroupMember(gid interface{}, user int, opt *UpdateGroupMemberOptions, options ...OptionFunc) (*GroupMember, *Response, error)

UpdateGroupMember updates a group team member to a specified access level.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-group-members

type Hook

type Hook struct {
	ID        int        `json:"id"`
	URL       string     `json:"url"`
	CreatedAt *time.Time `json:"created_at"`
}

Hook represents a GitLap system hook.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md

func (Hook) String

func (h Hook) String() string

type HookEvent

type HookEvent struct {
	EventName  string `json:"event_name"`
	Name       string `json:"name"`
	Path       string `json:"path"`
	ProjectID  int    `json:"project_id"`
	OwnerName  string `json:"owner_name"`
	OwnerEmail string `json:"owner_email"`
}

HookEvent represents an event triggert by a GitLab system hook.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md

func (HookEvent) String

func (h HookEvent) String() string

type Issue

type Issue struct {
	ID          int        `json:"id"`
	IID         int        `json:"iid"`
	ProjectID   int        `json:"project_id"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Labels      []string   `json:"labels"`
	Milestone   *Milestone `json:"milestone"`
	Assignee    struct {
		ID        int        `json:"id"`
		Username  string     `json:"username"`
		Email     string     `json:"email"`
		Name      string     `json:"name"`
		State     string     `json:"state"`
		CreatedAt *time.Time `json:"created_at"`
	} `json:"assignee"`
	Author struct {
		ID        int        `json:"id"`
		Username  string     `json:"username"`
		Email     string     `json:"email"`
		Name      string     `json:"name"`
		State     string     `json:"state"`
		CreatedAt *time.Time `json:"created_at"`
	} `json:"author"`
	State          string     `json:"state"`
	UpdatedAt      *time.Time `json:"updated_at"`
	CreatedAt      *time.Time `json:"created_at"`
	Subscribed     bool       `json:"subscribed"`
	UserNotesCount int        `json:"user_notes_count"`
	Confidential   bool       `json:"confidential"`
	DueDate        string     `json:"due_date"`
	WebURL         string     `json:"web_url"`
}

Issue represents a GitLab issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md

func (Issue) String

func (i Issue) String() string

type IssueCommentEvent

type IssueCommentEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	ProjectID  int    `json:"project_id"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository       *Repository `json:"repository"`
	ObjectAttributes struct {
		ID           int     `json:"id"`
		Note         string  `json:"note"`
		NoteableType string  `json:"noteable_type"`
		AuthorID     int     `json:"author_id"`
		CreatedAt    string  `json:"created_at"`
		UpdatedAt    string  `json:"updated_at"`
		ProjectID    int     `json:"project_id"`
		Attachment   string  `json:"attachment"`
		LineCode     string  `json:"line_code"`
		CommitID     string  `json:"commit_id"`
		NoteableID   int     `json:"noteable_id"`
		System       bool    `json:"system"`
		StDiff       []*Diff `json:"st_diff"`
		URL          string  `json:"url"`
	} `json:"object_attributes"`
	Issue *Issue `json:"issue"`
}

IssueCommentEvent represents a comment on an issue event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#comment-on-issue

type IssueEvent

type IssueEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository       *Repository `json:"repository"`
	ObjectAttributes struct {
		ID          int    `json:"id"`
		Title       string `json:"title"`
		AssigneeID  int    `json:"assignee_id"`
		AuthorID    int    `json:"author_id"`
		ProjectID   int    `json:"project_id"`
		CreatedAt   string `json:"created_at"` // Should be *time.Time (see Gitlab issue #21468)
		UpdatedAt   string `json:"updated_at"` // Should be *time.Time (see Gitlab issue #21468)
		Position    int    `json:"position"`
		BranchName  string `json:"branch_name"`
		Description string `json:"description"`
		MilestoneID int    `json:"milestone_id"`
		State       string `json:"state"`
		Iid         int    `json:"iid"`
		URL         string `json:"url"`
		Action      string `json:"action"`
	} `json:"object_attributes"`
	Assignee struct {
		Name      string `json:"name"`
		Username  string `json:"username"`
		AvatarURL string `json:"avatar_url"`
	} `json:"assignee"`
}

IssueEvent represents a issue event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#issues-events

type IssuesService

type IssuesService struct {
	// contains filtered or unexported fields
}

IssuesService handles communication with the issue related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md

func (*IssuesService) CreateIssue

func (s *IssuesService) CreateIssue(pid interface{}, opt *CreateIssueOptions, options ...OptionFunc) (*Issue, *Response, error)

CreateIssue creates a new project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#new-issues

func (*IssuesService) DeleteIssue

func (s *IssuesService) DeleteIssue(pid interface{}, issue int, options ...OptionFunc) (*Response, error)

DeleteIssue deletes a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#delete-an-issue

func (*IssuesService) GetIssue

func (s *IssuesService) GetIssue(pid interface{}, issue int, options ...OptionFunc) (*Issue, *Response, error)

GetIssue gets a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#single-issues

func (*IssuesService) ListIssues

func (s *IssuesService) ListIssues(opt *ListIssuesOptions, options ...OptionFunc) ([]*Issue, *Response, error)

ListIssues gets all issues created by authenticated user. This function takes pagination parameters page and per_page to restrict the list of issues.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#list-issues

func (*IssuesService) ListProjectIssues

func (s *IssuesService) ListProjectIssues(pid interface{}, opt *ListProjectIssuesOptions, options ...OptionFunc) ([]*Issue, *Response, error)

ListProjectIssues gets a list of project issues. This function accepts pagination parameters page and per_page to return the list of project issues.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#list-project-issues

func (*IssuesService) UpdateIssue

func (s *IssuesService) UpdateIssue(pid interface{}, issue int, opt *UpdateIssueOptions, options ...OptionFunc) (*Issue, *Response, error)

UpdateIssue updates an existing project issue. This function is also used to mark an issue as closed.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#edit-issues

type Label

type Label struct {
	Name                   string `json:"name"`
	Color                  string `json:"color"`
	Description            string `json:"description"`
	OpenIssuesCount        int    `json:"open_issues_count"`
	ClosedIssuesCount      int    `json:"closed_issues_count"`
	OpenMergeRequestsCount int    `json:"open_merge_requests_count"`
}

Label represents a GitLab label.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md

func (Label) String

func (l Label) String() string

type Labels

type Labels []string

Labels is a custom type with specific marshaling characteristics.

func (*Labels) MarshalJSON

func (l *Labels) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type LabelsService

type LabelsService struct {
	// contains filtered or unexported fields
}

LabelsService handles communication with the label related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md

func (*LabelsService) CreateLabel

func (s *LabelsService) CreateLabel(pid interface{}, opt *CreateLabelOptions, options ...OptionFunc) (*Label, *Response, error)

CreateLabel creates a new label for given repository with given name and color.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#create-a-new-label

func (*LabelsService) DeleteLabel

func (s *LabelsService) DeleteLabel(pid interface{}, opt *DeleteLabelOptions, options ...OptionFunc) (*Response, error)

DeleteLabel deletes a label given by its name.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#delete-a-label

func (*LabelsService) ListLabels

func (s *LabelsService) ListLabels(pid interface{}, options ...OptionFunc) ([]*Label, *Response, error)

ListLabels gets all labels for given project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#list-labels

func (*LabelsService) UpdateLabel

func (s *LabelsService) UpdateLabel(pid interface{}, opt *UpdateLabelOptions, options ...OptionFunc) (*Label, *Response, error)

UpdateLabel updates an existing label with new name or now color. At least one parameter is required, to update the label.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#edit-an-existing-label

type ListBranchesOptions

type ListBranchesOptions struct {
	ListOptions
}

ListBranchesOptions represents the available ListBranches() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#list-repository-branches

type ListBuildTriggersOptions

type ListBuildTriggersOptions struct {
	ListOptions
}

ListBuildTriggersOptions represents the available ListBuildTriggers() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_triggers.md#list-project-triggers

type ListBuildVariablesOptions

type ListBuildVariablesOptions struct {
	ListOptions
}

ListBuildVariablesOptions are the parameters to ListBuildVariables()

Gitlab API Docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_variables.md#list-project-variables

type ListBuildsOptions

type ListBuildsOptions struct {
	ListOptions
	Scope []BuildState `url:"scope,omitempty" json:"scope,omitempty"`
}

ListBuildsOptions are options for two list apis

type ListCommitsOptions

type ListCommitsOptions struct {
	ListOptions
	RefName *string   `url:"ref_name,omitempty" json:"ref_name,omitempty"`
	Since   time.Time `url:"since,omitempty" json:"since,omitempty"`
	Until   time.Time `url:"until,omitempty" json:"until,omitempty"`
}

ListCommitsOptions represents the available ListCommits() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#list-repository-commits

type ListGroupMembersOptions

type ListGroupMembersOptions struct {
	ListOptions
}

ListGroupMembersOptions represents the available ListGroupMembers() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-group-members

type ListGroupProjectsOptions

type ListGroupProjectsOptions struct {
	ListOptions
}

ListGroupProjectsOptions represents the available ListGroupProjects() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-a-group-s-projects

type ListGroupsOptions

type ListGroupsOptions struct {
	ListOptions
	Search     *string `url:"search,omitempty" json:"search,omitempty"`
	Statistics *bool   `url:"statistics,omitempty" json:"statistics,omitempty"`
}

ListGroupsOptions represents the available ListGroups() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#list-project-groups

type ListIssueNotesOptions

type ListIssueNotesOptions struct {
	ListOptions
}

ListIssueNotesOptions represents the available ListIssueNotes() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#list-project-issue-notes

type ListIssuesOptions

type ListIssuesOptions struct {
	ListOptions
	State   *string `url:"state,omitempty" json:"state,omitempty"`
	Labels  Labels  `url:"labels,comma,omitempty" json:"labels,omitempty"`
	OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort    *string `url:"sort,omitempty" json:"sort,omitempty"`
}

ListIssuesOptions represents the available ListIssues() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#list-issues

type ListMergeRequestsOptions

type ListMergeRequestsOptions struct {
	ListOptions
	IID     *int    `url:"iid,omitempty" json:"iid,omitempty"`
	State   *string `url:"state,omitempty" json:"state,omitempty"`
	OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort    *string `url:"sort,omitempty" json:"sort,omitempty"`
}

ListMergeRequestsOptions represents the available ListMergeRequests() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#list-merge-requests

type ListMilestonesOptions

type ListMilestonesOptions struct {
	ListOptions
	IID *int `url:"iid,omitempty" json:"iid,omitempty"`
}

ListMilestonesOptions represents the available ListMilestones() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#list-project-milestones

type ListNamespacesOptions

type ListNamespacesOptions struct {
	ListOptions
	Search *string `url:"search,omitempty" json:"search,omitempty"`
}

ListNamespacesOptions represents the available ListNamespaces() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/namespaces.md#list-namespaces

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty" json:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty" json:"per_page,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type ListProjectHooksOptions

type ListProjectHooksOptions struct {
	ListOptions
}

ListProjectHooksOptions represents the available ListProjectHooks() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-project-hooks

type ListProjectIssuesOptions

type ListProjectIssuesOptions struct {
	ListOptions
	IID       *int    `url:"iid,omitempty" json:"iid,omitempty"`
	State     *string `url:"state,omitempty" json:"state,omitempty"`
	Labels    Labels  `url:"labels,comma,omitempty" json:"labels,omitempty"`
	Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"`
	OrderBy   *string `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort      *string `url:"sort,omitempty" json:"sort,omitempty"`
}

ListProjectIssuesOptions represents the available ListProjectIssues() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#list-issues

type ListProjectMembersOptions

type ListProjectMembersOptions struct {
	ListOptions
	Query *string `url:"query,omitempty" json:"query,omitempty"`
}

ListProjectMembersOptions represents the available ListProjectMembers() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-project-team-members

type ListProjectsOptions

type ListProjectsOptions struct {
	ListOptions
	Archived   *bool   `url:"archived,omitempty" json:"archived,omitempty"`
	OrderBy    *string `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort       *string `url:"sort,omitempty" json:"sort,omitempty"`
	Search     *string `url:"search,omitempty" json:"search,omitempty"`
	Simple     *bool   `url:"simple,omitempty" json:"simple,omitempty"`
	Visibility *string `url:"visibility,omitempty" json:"visibility,omitempty"`
	Statistics *bool   `url:"statistics,omitempty" json:"statistics,omitempty"`
}

ListProjectsOptions represents the available ListProjects() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-projects

type ListSnippetsOptions

type ListSnippetsOptions struct {
	ListOptions
}

ListSnippetsOptions represents the available ListSnippets() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#list-snippets

type ListTreeOptions

type ListTreeOptions struct {
	Path      *string `url:"path,omitempty" json:"path,omitempty"`
	RefName   *string `url:"ref_name,omitempty" json:"ref_name,omitempty"`
	Recursive *bool   `url:"recursive,omitempty" json:"recursive,omitempty"`
}

ListTreeOptions represents the available ListTree() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#list-repository-tree

type ListUsersOptions

type ListUsersOptions struct {
	ListOptions
	Active   *bool   `url:"active,omitempty" json:"active,omitempty"`
	Search   *string `url:"search,omitempty" json:"search,omitempty"`
	Username *string `url:"username,omitempty" json:"username,omitempty"`
}

ListUsersOptions represents the available ListUsers() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-users

type MergeCommentEvent

type MergeCommentEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	ProjectID  int    `json:"project_id"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository       *Repository `json:"repository"`
	ObjectAttributes struct {
		ID           int    `json:"id"`
		Note         string `json:"note"`
		NoteableType string `json:"noteable_type"`
		AuthorID     int    `json:"author_id"`
		CreatedAt    string `json:"created_at"`
		UpdatedAt    string `json:"updated_at"`
		ProjectID    int    `json:"project_id"`
		Attachment   string `json:"attachment"`
		LineCode     string `json:"line_code"`
		CommitID     string `json:"commit_id"`
		NoteableID   int    `json:"noteable_id"`
		System       bool   `json:"system"`
		StDiff       *Diff  `json:"st_diff"`
		URL          string `json:"url"`
	} `json:"object_attributes"`
	MergeRequest *MergeRequest `json:"merge_request"`
}

MergeCommentEvent represents a comment on a merge event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#comment-on-merge-request

type MergeEvent

type MergeEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	ObjectAttributes struct {
		ID              int       `json:"id"`
		TargetBranch    string    `json:"target_branch"`
		SourceBranch    string    `json:"source_branch"`
		SourceProjectID int       `json:"source_project_id"`
		AuthorID        int       `json:"author_id"`
		AssigneeID      int       `json:"assignee_id"`
		Title           string    `json:"title"`
		CreatedAt       string    `json:"created_at"` // Should be *time.Time (see Gitlab issue #21468)
		UpdatedAt       string    `json:"updated_at"` // Should be *time.Time (see Gitlab issue #21468)
		StCommits       []*Commit `json:"st_commits"`
		StDiffs         []*Diff   `json:"st_diffs"`
		MilestoneID     int       `json:"milestone_id"`
		State           string    `json:"state"`
		MergeStatus     string    `json:"merge_status"`
		TargetProjectID int       `json:"target_project_id"`
		Iid             int       `json:"iid"`
		Description     string    `json:"description"`
		Position        int       `json:"position"`
		LockedAt        string    `json:"locked_at"`
		UpdatedByID     int       `json:"updated_by_id"`
		MergeError      string    `json:"merge_error"`
		MergeParams     struct {
			ForceRemoveSourceBranch string `json:"force_remove_source_branch"`
		} `json:"merge_params"`
		MergeWhenBuildSucceeds   bool        `json:"merge_when_build_succeeds"`
		MergeUserID              int         `json:"merge_user_id"`
		MergeCommitSha           string      `json:"merge_commit_sha"`
		DeletedAt                string      `json:"deleted_at"`
		ApprovalsBeforeMerge     string      `json:"approvals_before_merge"`
		RebaseCommitSha          string      `json:"rebase_commit_sha"`
		InProgressMergeCommitSha string      `json:"in_progress_merge_commit_sha"`
		LockVersion              int         `json:"lock_version"`
		TimeEstimate             int         `json:"time_estimate"`
		Source                   *Repository `json:"source"`
		Target                   *Repository `json:"target"`
		LastCommit               struct {
			ID        string     `json:"id"`
			Message   string     `json:"message"`
			Timestamp *time.Time `json:"timestamp"`
			URL       string     `json:"url"`
			Author    *Author    `json:"author"`
		} `json:"last_commit"`
		WorkInProgress bool   `json:"work_in_progress"`
		URL            string `json:"url"`
		Action         string `json:"action"`
		Assignee       struct {
			Name      string `json:"name"`
			Username  string `json:"username"`
			AvatarURL string `json:"avatar_url"`
		} `json:"assignee"`
	} `json:"object_attributes"`
	Repository *Repository `json:"repository"`
	Assignee   struct {
		Name      string `json:"name"`
		Username  string `json:"username"`
		AvatarURL string `json:"avatar_url"`
	} `json:"assignee"`
}

MergeEvent represents a merge event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#merge-request-events

type MergeRequest

type MergeRequest struct {
	ID             int        `json:"id"`
	IID            int        `json:"iid"`
	ProjectID      int        `json:"project_id"`
	Title          string     `json:"title"`
	Description    string     `json:"description"`
	WorkInProgress bool       `json:"work_in_progress"`
	State          string     `json:"state"`
	CreatedAt      *time.Time `json:"created_at"`
	UpdatedAt      *time.Time `json:"updated_at"`
	TargetBranch   string     `json:"target_branch"`
	SourceBranch   string     `json:"source_branch"`
	Upvotes        int        `json:"upvotes"`
	Downvotes      int        `json:"downvotes"`
	Author         struct {
		Name      string `json:"name"`
		Username  string `json:"username"`
		ID        int    `json:"id"`
		State     string `json:"state"`
		AvatarURL string `json:"avatar_url"`
	} `json:"author"`
	Assignee struct {
		Name      string `json:"name"`
		Username  string `json:"username"`
		ID        int    `json:"id"`
		State     string `json:"state"`
		AvatarURL string `json:"avatar_url"`
	} `json:"assignee"`
	SourceProjectID int      `json:"source_project_id"`
	TargetProjectID int      `json:"target_project_id"`
	Labels          []string `json:"labels"`
	Milestone       struct {
		ID          int        `json:"id"`
		Iid         int        `json:"iid"`
		ProjectID   int        `json:"project_id"`
		Title       string     `json:"title"`
		Description string     `json:"description"`
		State       string     `json:"state"`
		CreatedAt   *time.Time `json:"created_at"`
		UpdatedAt   *time.Time `json:"updated_at"`
		DueDate     string     `json:"due_date"`
	} `json:"milestone"`
	MergeWhenBuildSucceeds  bool   `json:"merge_when_build_succeeds"`
	MergeStatus             string `json:"merge_status"`
	SHA                     string `json:"sha"`
	Subscribed              bool   `json:"subscribed"`
	UserNotesCount          int    `json:"user_notes_count"`
	SouldRemoveSourceBranch bool   `json:"should_remove_source_branch"`
	ForceRemoveSourceBranch bool   `json:"force_remove_source_branch"`
	Changes                 []struct {
		OldPath     string `json:"old_path"`
		NewPath     string `json:"new_path"`
		AMode       string `json:"a_mode"`
		BMode       string `json:"b_mode"`
		Diff        string `json:"diff"`
		NewFile     bool   `json:"new_file"`
		RenamedFile bool   `json:"renamed_file"`
		DeletedFile bool   `json:"deleted_file"`
	} `json:"changes"`
	WebURL string `json:"web_url"`
}

MergeRequest represents a GitLab merge request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md

func (MergeRequest) String

func (m MergeRequest) String() string

type MergeRequestsService

type MergeRequestsService struct {
	// contains filtered or unexported fields
}

MergeRequestsService handles communication with the merge requests related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md

func (*MergeRequestsService) AcceptMergeRequest

func (s *MergeRequestsService) AcceptMergeRequest(pid interface{}, mergeRequest int, opt *AcceptMergeRequestOptions, options ...OptionFunc) (*MergeRequest, *Response, error)

AcceptMergeRequest merges changes submitted with MR using this API. If merge success you get 200 OK. If it has some conflicts and can not be merged - you get 405 and error message 'Branch cannot be merged'. If merge request is already merged or closed - you get 405 and error message 'Method Not Allowed'

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#accept-mr

func (*MergeRequestsService) CreateMergeRequest

func (s *MergeRequestsService) CreateMergeRequest(pid interface{}, opt *CreateMergeRequestOptions, options ...OptionFunc) (*MergeRequest, *Response, error)

CreateMergeRequest creates a new merge request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#create-mr

func (*MergeRequestsService) GetMergeRequest

func (s *MergeRequestsService) GetMergeRequest(pid interface{}, mergeRequest int, options ...OptionFunc) (*MergeRequest, *Response, error)

GetMergeRequest shows information about a single merge request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#get-single-mr

func (*MergeRequestsService) GetMergeRequestChanges

func (s *MergeRequestsService) GetMergeRequestChanges(pid interface{}, mergeRequest int, options ...OptionFunc) (*MergeRequest, *Response, error)

GetMergeRequestChanges shows information about the merge request including its files and changes.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#get-single-mr-changes

func (*MergeRequestsService) GetMergeRequestCommits

func (s *MergeRequestsService) GetMergeRequestCommits(pid interface{}, mergeRequest int, options ...OptionFunc) ([]*Commit, *Response, error)

GetMergeRequestCommits gets a list of merge request commits.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#get-single-mr-commits

func (*MergeRequestsService) ListMergeRequests

func (s *MergeRequestsService) ListMergeRequests(pid interface{}, opt *ListMergeRequestsOptions, options ...OptionFunc) ([]*MergeRequest, *Response, error)

ListMergeRequests gets all merge requests for this project. The state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all). The pagination parameters page and per_page can be used to restrict the list of merge requests.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#list-merge-requests

func (*MergeRequestsService) UpdateMergeRequest

func (s *MergeRequestsService) UpdateMergeRequest(pid interface{}, mergeRequest int, opt *UpdateMergeRequestOptions, options ...OptionFunc) (*MergeRequest, *Response, error)

UpdateMergeRequest updates an existing project milestone.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#update-mr

type Milestone

type Milestone struct {
	ID          int        `json:"id"`
	Iid         int        `json:"iid"`
	ProjectID   int        `json:"project_id"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	StartDate   string     `json:"start_date"`
	DueDate     string     `json:"due_date"`
	State       string     `json:"state"`
	UpdatedAt   *time.Time `json:"updated_at"`
	CreatedAt   *time.Time `json:"created_at"`
}

Milestone represents a GitLab milestone.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md

func (Milestone) String

func (m Milestone) String() string

type MilestonesService

type MilestonesService struct {
	// contains filtered or unexported fields
}

MilestonesService handles communication with the milestone related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md

func (*MilestonesService) CreateMilestone

func (s *MilestonesService) CreateMilestone(pid interface{}, opt *CreateMilestoneOptions, options ...OptionFunc) (*Milestone, *Response, error)

CreateMilestone creates a new project milestone.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#create-new-milestone

func (*MilestonesService) GetMilestone

func (s *MilestonesService) GetMilestone(pid interface{}, milestone int, options ...OptionFunc) (*Milestone, *Response, error)

GetMilestone gets a single project milestone.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#get-single-milestone

func (*MilestonesService) GetMilestoneIssues

func (s *MilestonesService) GetMilestoneIssues(pid interface{}, milestone int, opt *GetMilestoneIssuesOptions, options ...OptionFunc) ([]*Issue, *Response, error)

GetMilestoneIssues gets all issues assigned to a single project milestone.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#get-all-issues-assigned-to-a-single-milestone

func (*MilestonesService) ListMilestones

func (s *MilestonesService) ListMilestones(pid interface{}, opt *ListMilestonesOptions, options ...OptionFunc) ([]*Milestone, *Response, error)

ListMilestones returns a list of project milestones.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#list-project-milestones

func (*MilestonesService) UpdateMilestone

func (s *MilestonesService) UpdateMilestone(pid interface{}, milestone int, opt *UpdateMilestoneOptions, options ...OptionFunc) (*Milestone, *Response, error)

UpdateMilestone updates an existing project milestone.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#edit-milestone

type ModifyUserOptions

type ModifyUserOptions struct {
	Email          *string `url:"email,omitempty" json:"email,omitempty"`
	Password       *string `url:"password,omitempty" json:"password,omitempty"`
	Username       *string `url:"username,omitempty" json:"username,omitempty"`
	Name           *string `url:"name,omitempty" json:"name,omitempty"`
	Skype          *string `url:"skype,omitempty" json:"skype,omitempty"`
	Linkedin       *string `url:"linkedin,omitempty" json:"linkedin,omitempty"`
	Twitter        *string `url:"twitter,omitempty" json:"twitter,omitempty"`
	WebsiteURL     *string `url:"website_url,omitempty" json:"website_url,omitempty"`
	ProjectsLimit  *int    `url:"projects_limit,omitempty" json:"projects_limit,omitempty"`
	ExternUID      *string `url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
	Provider       *string `url:"provider,omitempty" json:"provider,omitempty"`
	Bio            *string `url:"bio,omitempty" json:"bio,omitempty"`
	Admin          *bool   `url:"admin,omitempty" json:"admin,omitempty"`
	CanCreateGroup *bool   `url:"can_create_group,omitempty" json:"can_create_group,omitempty"`
}

ModifyUserOptions represents the available ModifyUser() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#user-modification

type Namespace

type Namespace struct {
	ID   int    `json:"id"`
	Path string `json:"path"`
	Kind string `json:"kind"`
}

Namespace represents a GitLab namespace.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/namespaces.md

func (Namespace) String

func (n Namespace) String() string

type NamespacesService

type NamespacesService struct {
	// contains filtered or unexported fields
}

NamespacesService handles communication with the namespace related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/namespaces.md

func (*NamespacesService) ListNamespaces

func (s *NamespacesService) ListNamespaces(opt *ListNamespacesOptions, options ...OptionFunc) ([]*Namespace, *Response, error)

ListNamespaces gets a list of projects accessible by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/namespaces.md#list-namespaces

func (*NamespacesService) SearchNamespace

func (s *NamespacesService) SearchNamespace(query string, options ...OptionFunc) ([]*Namespace, *Response, error)

SearchNamespace gets all namespaces that match your string in their name or path.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/namespaces.md#search-for-namespace

type Note

type Note struct {
	ID         int    `json:"id"`
	Body       string `json:"body"`
	Attachment string `json:"attachment"`
	Title      string `json:"title"`
	FileName   string `json:"file_name"`
	Author     struct {
		ID        int        `json:"id"`
		Username  string     `json:"username"`
		Email     string     `json:"email"`
		Name      string     `json:"name"`
		State     string     `json:"state"`
		CreatedAt *time.Time `json:"created_at"`
	} `json:"author"`
	System    bool       `json:"system"`
	Upvote    bool       `json:"upvote"`
	Downvote  bool       `json:"downvote"`
	ExpiresAt *time.Time `json:"expires_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	CreatedAt *time.Time `json:"created_at"`
}

Note represents a GitLab note.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md

func (Note) String

func (n Note) String() string

type NotesService

type NotesService struct {
	// contains filtered or unexported fields
}

NotesService handles communication with the notes related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md

func (*NotesService) CreateIssueNote

func (s *NotesService) CreateIssueNote(pid interface{}, issue int, opt *CreateIssueNoteOptions, options ...OptionFunc) (*Note, *Response, error)

CreateIssueNote creates a new note to a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#create-new-issue-note

func (*NotesService) CreateMergeRequestNote

func (s *NotesService) CreateMergeRequestNote(pid interface{}, mergeRequest int, opt *CreateMergeRequestNoteOptions, options ...OptionFunc) (*Note, *Response, error)

CreateMergeRequestNote creates a new note for a single merge request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#create-new-merge-request-note

func (*NotesService) CreateSnippetNote

func (s *NotesService) CreateSnippetNote(pid interface{}, snippet int, opt *CreateSnippetNoteOptions, options ...OptionFunc) (*Note, *Response, error)

CreateSnippetNote creates a new note for a single snippet. Snippet notes are comments users can post to a snippet.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#create-new-snippet-note

func (*NotesService) DeleteIssueNote

func (s *NotesService) DeleteIssueNote(pid interface{}, issue, note int, options ...OptionFunc) (*Response, error)

DeleteIssueNote deletes an existing note of an issue.

https://docs.gitlab.com/ce/api/notes.html#delete-an-issue-note

func (*NotesService) DeleteMergeRequestNote

func (s *NotesService) DeleteMergeRequestNote(pid interface{}, mergeRequest, note int, options ...OptionFunc) (*Response, error)

DeleteMergeRequestNote deletes an existing note of a merge request.

https://docs.gitlab.com/ce/api/notes.html#delete-a-merge-request-note

func (*NotesService) DeleteSnippetNote

func (s *NotesService) DeleteSnippetNote(pid interface{}, snippet, note int, options ...OptionFunc) (*Response, error)

DeleteSnippetNote deletes an existing note of a snippet.

https://docs.gitlab.com/ce/api/notes.html#delete-a-snippet-note

func (*NotesService) GetIssueNote

func (s *NotesService) GetIssueNote(pid interface{}, issue, note int, options ...OptionFunc) (*Note, *Response, error)

GetIssueNote returns a single note for a specific project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#get-single-issue-note

func (*NotesService) GetMergeRequestNote

func (s *NotesService) GetMergeRequestNote(pid interface{}, mergeRequest, note int, options ...OptionFunc) (*Note, *Response, error)

GetMergeRequestNote returns a single note for a given merge request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#get-single-merge-request-note

func (*NotesService) GetSnippetNote

func (s *NotesService) GetSnippetNote(pid interface{}, snippet, note int, options ...OptionFunc) (*Note, *Response, error)

GetSnippetNote returns a single note for a given snippet.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#get-single-snippet-note

func (*NotesService) ListIssueNotes

func (s *NotesService) ListIssueNotes(pid interface{}, issue int, opt *ListIssueNotesOptions, options ...OptionFunc) ([]*Note, *Response, error)

ListIssueNotes gets a list of all notes for a single issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#list-project-issue-notes

func (*NotesService) ListMergeRequestNotes

func (s *NotesService) ListMergeRequestNotes(pid interface{}, mergeRequest int, options ...OptionFunc) ([]*Note, *Response, error)

ListMergeRequestNotes gets a list of all notes for a single merge request.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#list-all-merge-request-notes

func (*NotesService) ListSnippetNotes

func (s *NotesService) ListSnippetNotes(pid interface{}, snippet int, options ...OptionFunc) ([]*Note, *Response, error)

ListSnippetNotes gets a list of all notes for a single snippet. Snippet notes are comments users can post to a snippet.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#list-all-snippet-notes

func (*NotesService) UpdateIssueNote

func (s *NotesService) UpdateIssueNote(pid interface{}, issue, note int, opt *UpdateIssueNoteOptions, options ...OptionFunc) (*Note, *Response, error)

UpdateIssueNote modifies existing note of an issue.

https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#modify-existing-issue-note

func (*NotesService) UpdateMergeRequestNote

func (s *NotesService) UpdateMergeRequestNote(pid interface{}, mergeRequest, note int, opt *UpdateMergeRequestNoteOptions, options ...OptionFunc) (*Note, *Response, error)

UpdateMergeRequestNote modifies existing note of a merge request.

https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#modify-existing-merge-request-note

func (*NotesService) UpdateSnippetNote

func (s *NotesService) UpdateSnippetNote(pid interface{}, snippet, note int, opt *UpdateSnippetNoteOptions, options ...OptionFunc) (*Note, *Response, error)

UpdateSnippetNote modifies existing note of a snippet.

https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#modify-existing-snippet-note

type NotificationEvents

type NotificationEvents struct {
	CloseIssue           bool `json:"close_issue"`
	CloseMergeRequest    bool `json:"close_merge_request"`
	FailedPipeline       bool `json:"failed_pipeline"`
	MergeMergeRequest    bool `json:"merge_merge_request"`
	NewIssue             bool `json:"new_issue"`
	NewMergeRequest      bool `json:"new_merge_request"`
	NewNote              bool `json:"new_note"`
	ReassignIssue        bool `json:"reassign_issue"`
	ReassignMergeRequest bool `json:"reassign_merge_request"`
	ReopenIssue          bool `json:"reopen_issue"`
	ReopenMergeRequest   bool `json:"reopen_merge_request"`
	SuccessPipeline      bool `json:"success_pipeline"`
}

NotificationEvents represents the avialable notification setting events.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#notification-settings

type NotificationLevelValue

type NotificationLevelValue int

NotificationLevelValue represents a notification level.

const (
	DisabledNotificationLevel NotificationLevelValue = iota
	ParticipatingNotificationLevel
	WatchNotificationLevel
	GlobalNotificationLevel
	MentionNotificationLevel
	CustomNotificationLevel
)

List of valid notification levels.

func NotificationLevel

func NotificationLevel(v NotificationLevelValue) *NotificationLevelValue

NotificationLevel is a helper routine that allocates a new NotificationLevelValue to store v and returns a pointer to it.

func (NotificationLevelValue) MarshalJSON

func (l NotificationLevelValue) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (NotificationLevelValue) String

func (l NotificationLevelValue) String() string

String implements the fmt.Stringer interface.

func (*NotificationLevelValue) UnmarshalJSON

func (l *NotificationLevelValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type NotificationSettings

type NotificationSettings struct {
	Level             NotificationLevelValue `json:"level"`
	NotificationEmail string                 `json:"notification_email"`
	Events            *NotificationEvents    `json:"events"`
}

NotificationSettings represents the Gitlab notification setting.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#notification-settings

func (NotificationSettings) String

func (ns NotificationSettings) String() string

type NotificationSettingsOptions

type NotificationSettingsOptions struct {
	Level                *NotificationLevelValue `url:"level,omitempty" json:"level,omitempty"`
	NotificationEmail    *string                 `url:"notification_email,omitempty" json:"notification_email,omitempty"`
	CloseIssue           *bool                   `url:"close_issue,omitempty" json:"close_issue,omitempty"`
	CloseMergeRequest    *bool                   `url:"close_merge_request,omitempty" json:"close_merge_request,omitempty"`
	FailedPipeline       *bool                   `url:"failed_pipeline,omitempty" json:"failed_pipeline,omitempty"`
	MergeMergeRequest    *bool                   `url:"merge_merge_request,omitempty" json:"merge_merge_request,omitempty"`
	NewIssue             *bool                   `url:"new_issue,omitempty" json:"new_issue,omitempty"`
	NewMergeRequest      *bool                   `url:"new_merge_request,omitempty" json:"new_merge_request,omitempty"`
	NewNote              *bool                   `url:"new_note,omitempty" json:"new_note,omitempty"`
	ReassignIssue        *bool                   `url:"reassign_issue,omitempty" json:"reassign_issue,omitempty"`
	ReassignMergeRequest *bool                   `url:"reassign_merge_request,omitempty" json:"reassign_merge_request,omitempty"`
	ReopenIssue          *bool                   `url:"reopen_issue,omitempty" json:"reopen_issue,omitempty"`
	ReopenMergeRequest   *bool                   `url:"reopen_merge_request,omitempty" json:"reopen_merge_request,omitempty"`
	SuccessPipeline      *bool                   `url:"success_pipeline,omitempty" json:"success_pipeline,omitempty"`
}

NotificationSettingsOptions represents the available options that can be passed to the API when updating the notification settings.

type NotificationSettingsService

type NotificationSettingsService struct {
	// contains filtered or unexported fields
}

NotificationSettingsService handles communication with the notification settings related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md

func (*NotificationSettingsService) GetGlobalSettings

func (s *NotificationSettingsService) GetGlobalSettings(options ...OptionFunc) (*NotificationSettings, *Response, error)

GetGlobalSettings returns current notification settings and email address.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#global-notification-settings

func (*NotificationSettingsService) GetSettingsForGroup

func (s *NotificationSettingsService) GetSettingsForGroup(gid interface{}, options ...OptionFunc) (*NotificationSettings, *Response, error)

GetSettingsForGroup returns current group notification settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#group-project-level-notification-settings

func (*NotificationSettingsService) GetSettingsForProject

func (s *NotificationSettingsService) GetSettingsForProject(pid interface{}, options ...OptionFunc) (*NotificationSettings, *Response, error)

GetSettingsForProject returns current project notification settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#group-project-level-notification-settings

func (*NotificationSettingsService) UpdateGlobalSettings

UpdateGlobalSettings updates current notification settings and email address.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#update-global-notification-settings

func (*NotificationSettingsService) UpdateSettingsForGroup

func (s *NotificationSettingsService) UpdateSettingsForGroup(gid interface{}, opt *NotificationSettingsOptions, options ...OptionFunc) (*NotificationSettings, *Response, error)

UpdateSettingsForGroup updates current group notification settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#update-group-project-level-notification-settings

func (*NotificationSettingsService) UpdateSettingsForProject

func (s *NotificationSettingsService) UpdateSettingsForProject(pid interface{}, opt *NotificationSettingsOptions, options ...OptionFunc) (*NotificationSettings, *Response, error)

UpdateSettingsForProject updates current project notification settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notification_settings.md#update-group-project-level-notification-settings

type OptionFunc

type OptionFunc func(*http.Request) error

OptionFunc can be passed to all API requests to make the API call as if you were another user, provided your private token is from an administrator account.

GitLab docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/README.md#sudo

func WithContext

func WithContext(ctx context.Context) OptionFunc

WithContext runs the request with the provided context

func WithSudo

func WithSudo(uid interface{}) OptionFunc

WithSudo takes either a username or user ID and sets the SUDO request header

type Permissions

type Permissions struct {
	ProjectAccess *ProjectAccess `json:"project_access"`
	GroupAccess   *GroupAccess   `json:"group_access"`
}

Permissions represents premissions.

type Pipeline

type Pipeline struct {
	ID         int    `json:"id"`
	Status     string `json:"status"`
	Ref        string `json:"ref"`
	Sha        string `json:"sha"`
	BeforeSha  string `json:"before_sha"`
	Tag        bool   `json:"tag"`
	YamlErrors string `json:"yaml_errors"`
	User       struct {
		Name      string `json:"name"`
		Username  string `json:"username"`
		ID        int    `json:"id"`
		State     string `json:"state"`
		AvatarURL string `json:"avatar_url"`
		WebURL    string `json:"web_url"`
	}
	UpdatedAt   *time.Time `json:"updated_at"`
	CreatedAt   *time.Time `json:"created_at"`
	StartedAt   *time.Time `json:"started_at"`
	FinishedAt  *time.Time `json:"finished_at"`
	CommittedAt *time.Time `json:"committed_at"`
	Duration    int        `json:"duration"`
	Coverage    string     `json:"coverage"`
}

Pipeline represents a GitLab pipeline.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md

func (Pipeline) String

func (i Pipeline) String() string

type PipelineEvent

type PipelineEvent struct {
	ObjectKind       string `json:"object_kind"`
	ObjectAttributes struct {
		ID         int      `json:"id"`
		Ref        string   `json:"ref"`
		Tag        bool     `json:"tag"`
		Sha        string   `json:"sha"`
		BeforeSha  string   `json:"before_sha"`
		Status     string   `json:"status"`
		Stages     []string `json:"stages"`
		CreatedAt  string   `json:"created_at"`
		FinishedAt string   `json:"finished_at"`
		Duration   int      `json:"duration"`
	} `json:"object_attributes"`
	User struct {
		Name      string `json:"name"`
		Username  string `json:"username"`
		AvatarURL string `json:"avatar_url"`
	} `json:"user"`
	Project struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Commit struct {
		ID        string    `json:"id"`
		Message   string    `json:"message"`
		Timestamp time.Time `json:"timestamp"`
		URL       string    `json:"url"`
		Author    struct {
			Name  string `json:"name"`
			Email string `json:"email"`
		} `json:"author"`
	} `json:"commit"`
	Builds []struct {
		ID         int    `json:"id"`
		Stage      string `json:"stage"`
		Name       string `json:"name"`
		Status     string `json:"status"`
		CreatedAt  string `json:"created_at"`
		StartedAt  string `json:"started_at"`
		FinishedAt string `json:"finished_at"`
		When       string `json:"when"`
		Manual     bool   `json:"manual"`
		User       struct {
			Name      string `json:"name"`
			Username  string `json:"username"`
			AvatarURL string `json:"avatar_url"`
		} `json:"user"`
		Runner        string `json:"runner"`
		ArtifactsFile struct {
			Filename string `json:"filename"`
			Size     string `json:"size"`
		} `json:"artifacts_file"`
	} `json:"builds"`
}

PipelineEvent represents a pipeline event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#pipeline-events

type PipelinesService

type PipelinesService struct {
	// contains filtered or unexported fields
}

PipelinesService handles communication with the repositories related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md

func (*PipelinesService) CancelPipelineBuild

func (s *PipelinesService) CancelPipelineBuild(pid interface{}, pipelineID int, options ...OptionFunc) (*Pipeline, *Response, error)

CancelPipelineBuild cancels a pipeline builds

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md#cancel-a-pipelines-builds

func (*PipelinesService) CreatePipeline

func (s *PipelinesService) CreatePipeline(pid interface{}, opt *CreatePipelineOptions, options ...OptionFunc) (*Pipeline, *Response, error)

CreatePipeline creates a new project pipeline.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md#create-a-new-pipeline

func (*PipelinesService) GetPipeline

func (s *PipelinesService) GetPipeline(pid interface{}, pipeline int, options ...OptionFunc) (*Pipeline, *Response, error)

GetPipeline gets a single project pipeline.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md#get-a-single-pipeline

func (*PipelinesService) ListProjectPipelines

func (s *PipelinesService) ListProjectPipelines(pid interface{}, options ...OptionFunc) ([]*Pipeline, *Response, error)

ListProjectPipelines gets a list of project piplines.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md#list-project-pipelines

func (*PipelinesService) RetryPipelineBuild

func (s *PipelinesService) RetryPipelineBuild(pid interface{}, pipelineID int, options ...OptionFunc) (*Pipeline, *Response, error)

RetryPipelineBuild retries failed builds in a pipeline

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/pipelines.md#retry-failed-builds-in-a-pipeline

type PostCommitCommentOptions

type PostCommitCommentOptions struct {
	Note     *string `url:"note,omitempty" json:"note,omitempty"`
	Path     *string `url:"path" json:"path"`
	Line     *int    `url:"line" json:"line"`
	LineType *string `url:"line_type" json:"line_type"`
}

PostCommitCommentOptions represents the available PostCommitComment() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#post-comment-to-commit

type Project

type Project struct {
	ID                                        int                  `json:"id"`
	Description                               string               `json:"description"`
	DefaultBranch                             string               `json:"default_branch"`
	Public                                    bool                 `json:"public"`
	VisibilityLevel                           VisibilityLevelValue `json:"visibility_level"`
	SSHURLToRepo                              string               `json:"ssh_url_to_repo"`
	HTTPURLToRepo                             string               `json:"http_url_to_repo"`
	WebURL                                    string               `json:"web_url"`
	TagList                                   []string             `json:"tag_list"`
	Owner                                     *User                `json:"owner"`
	Name                                      string               `json:"name"`
	NameWithNamespace                         string               `json:"name_with_namespace"`
	Path                                      string               `json:"path"`
	PathWithNamespace                         string               `json:"path_with_namespace"`
	IssuesEnabled                             bool                 `json:"issues_enabled"`
	OpenIssuesCount                           int                  `json:"open_issues_count"`
	MergeRequestsEnabled                      bool                 `json:"merge_requests_enabled"`
	ApprovalsBeforeMerge                      int                  `json:"approvals_before_merge"`
	BuildsEnabled                             bool                 `json:"builds_enabled"`
	WikiEnabled                               bool                 `json:"wiki_enabled"`
	SnippetsEnabled                           bool                 `json:"snippets_enabled"`
	ContainerRegistryEnabled                  bool                 `json:"container_registry_enabled"`
	CreatedAt                                 *time.Time           `json:"created_at,omitempty"`
	LastActivityAt                            *time.Time           `json:"last_activity_at,omitempty"`
	CreatorID                                 int                  `json:"creator_id"`
	Namespace                                 *ProjectNamespace    `json:"namespace"`
	Permissions                               *Permissions         `json:"permissions"`
	Archived                                  bool                 `json:"archived"`
	AvatarURL                                 string               `json:"avatar_url"`
	SharedRunnersEnabled                      bool                 `json:"shared_runners_enabled"`
	ForksCount                                int                  `json:"forks_count"`
	StarCount                                 int                  `json:"star_count"`
	RunnersToken                              string               `json:"runners_token"`
	PublicBuilds                              bool                 `json:"public_builds"`
	OnlyAllowMergeIfBuildSucceeds             bool                 `json:"only_allow_merge_if_build_succeeds"`
	OnlyAllowMergeIfAllDiscussionsAreResolved bool                 `json:"only_allow_merge_if_all_discussions_are_resolved"`
	LFSEnabled                                bool                 `json:"lfs_enabled"`
	RequestAccessEnabled                      bool                 `json:"request_access_enabled"`
	ForkedFromProject                         *ForkParent          `json:"forked_from_project"`
	SharedWithGroups                          []struct {
		GroupID          int    `json:"group_id"`
		GroupName        string `json:"group_name"`
		GroupAccessLevel int    `json:"group_access_level"`
	} `json:"shared_with_groups"`
	Statistics *ProjectStatistics `json:"statistics"`
}

Project represents a GitLab project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md

func (Project) String

func (s Project) String() string

type ProjectAccess

type ProjectAccess struct {
	AccessLevel       AccessLevelValue       `json:"access_level"`
	NotificationLevel NotificationLevelValue `json:"notification_level"`
}

ProjectAccess represents project access.

type ProjectEvent

type ProjectEvent struct {
	Title          interface{} `json:"title"`
	ProjectID      int         `json:"project_id"`
	ActionName     string      `json:"action_name"`
	TargetID       interface{} `json:"target_id"`
	TargetType     interface{} `json:"target_type"`
	AuthorID       int         `json:"author_id"`
	AuthorUsername string      `json:"author_username"`
	Data           struct {
		Before            string      `json:"before"`
		After             string      `json:"after"`
		Ref               string      `json:"ref"`
		UserID            int         `json:"user_id"`
		UserName          string      `json:"user_name"`
		Repository        *Repository `json:"repository"`
		Commits           []*Commit   `json:"commits"`
		TotalCommitsCount int         `json:"total_commits_count"`
	} `json:"data"`
	TargetTitle interface{} `json:"target_title"`
}

ProjectEvent represents a GitLab project event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#get-project-events

func (ProjectEvent) String

func (s ProjectEvent) String() string

type ProjectForkRelation

type ProjectForkRelation struct {
	ID                  int        `json:"id"`
	ForkedToProjectID   int        `json:"forked_to_project_id"`
	ForkedFromProjectID int        `json:"forked_from_project_id"`
	CreatedAt           *time.Time `json:"created_at"`
	UpdatedAt           *time.Time `json:"updated_at"`
}

ProjectForkRelation represents a project fork relationship.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#admin-fork-relation

type ProjectHook

type ProjectHook struct {
	ID                    int        `json:"id"`
	URL                   string     `json:"url"`
	ProjectID             int        `json:"project_id"`
	PushEvents            bool       `json:"push_events"`
	IssuesEvents          bool       `json:"issues_events"`
	MergeRequestsEvents   bool       `json:"merge_requests_events"`
	TagPushEvents         bool       `json:"tag_push_events"`
	NoteEvents            bool       `json:"note_events"`
	BuildEvents           bool       `json:"build_events"`
	PipelineEvents        bool       `json:"pipeline_events"`
	WikiPageEvents        bool       `json:"wiki_page_events"`
	EnableSSLVerification bool       `json:"enable_ssl_verification"`
	CreatedAt             *time.Time `json:"created_at"`
}

ProjectHook represents a project hook.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-project-hooks

type ProjectMember

type ProjectMember struct {
	ID          int              `json:"id"`
	Username    string           `json:"username"`
	Email       string           `json:"email"`
	Name        string           `json:"name"`
	State       string           `json:"state"`
	CreatedAt   *time.Time       `json:"created_at"`
	AccessLevel AccessLevelValue `json:"access_level"`
}

ProjectMember represents a project member.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-project-team-members

type ProjectNamespace

type ProjectNamespace struct {
	CreatedAt   *time.Time `json:"created_at"`
	Description string     `json:"description"`
	ID          int        `json:"id"`
	Name        string     `json:"name"`
	OwnerID     int        `json:"owner_id"`
	Path        string     `json:"path"`
	UpdatedAt   *time.Time `json:"updated_at"`
}

ProjectNamespace represents a project namespace.

type ProjectSnippetsService

type ProjectSnippetsService struct {
	// contains filtered or unexported fields
}

ProjectSnippetsService handles communication with the project snippets related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md

func (*ProjectSnippetsService) CreateSnippet

func (s *ProjectSnippetsService) CreateSnippet(pid interface{}, opt *CreateSnippetOptions, options ...OptionFunc) (*Snippet, *Response, error)

CreateSnippet creates a new project snippet. The user must have permission to create new snippets.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#create-new-snippet

func (*ProjectSnippetsService) DeleteSnippet

func (s *ProjectSnippetsService) DeleteSnippet(pid interface{}, snippet int, options ...OptionFunc) (*Response, error)

DeleteSnippet deletes an existing project snippet. This is an idempotent function and deleting a non-existent snippet still returns a 200 OK status code.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#delete-snippet

func (*ProjectSnippetsService) GetSnippet

func (s *ProjectSnippetsService) GetSnippet(pid interface{}, snippet int, options ...OptionFunc) (*Snippet, *Response, error)

GetSnippet gets a single project snippet

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#single-snippet

func (*ProjectSnippetsService) ListSnippets

func (s *ProjectSnippetsService) ListSnippets(pid interface{}, opt *ListSnippetsOptions, options ...OptionFunc) ([]*Snippet, *Response, error)

ListSnippets gets a list of project snippets.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#list-snippets

func (*ProjectSnippetsService) SnippetContent

func (s *ProjectSnippetsService) SnippetContent(pid interface{}, snippet int, options ...OptionFunc) ([]byte, *Response, error)

SnippetContent returns the raw project snippet as plain text.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#snippet-content

func (*ProjectSnippetsService) UpdateSnippet

func (s *ProjectSnippetsService) UpdateSnippet(pid interface{}, snippet int, opt *UpdateSnippetOptions, options ...OptionFunc) (*Snippet, *Response, error)

UpdateSnippet updates an existing project snippet. The user must have permission to change an existing snippet.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#update-snippet

type ProjectStatistics

type ProjectStatistics struct {
	StorageStatistics
	CommitCount int `json:"commit_count"`
}

ProjectStatistics represents a statistics record for a project.

type ProjectsService

type ProjectsService struct {
	// contains filtered or unexported fields
}

ProjectsService handles communication with the repositories related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md

func (*ProjectsService) AddBuildTrigger

func (s *ProjectsService) AddBuildTrigger(pid interface{}, options ...OptionFunc) (*BuildTrigger, *Response, error)

AddBuildTrigger adds a build trigger to a specified project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_triggers.md#create-a-project-trigger

func (*ProjectsService) AddProjectHook

func (s *ProjectsService) AddProjectHook(pid interface{}, opt *AddProjectHookOptions, options ...OptionFunc) (*ProjectHook, *Response, error)

AddProjectHook adds a hook to a specified project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#add-project-hook

func (*ProjectsService) AddProjectMember

func (s *ProjectsService) AddProjectMember(pid interface{}, opt *AddProjectMemberOptions, options ...OptionFunc) (*ProjectMember, *Response, error)

AddProjectMember adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#add-project-team-member

func (*ProjectsService) ArchiveProject

func (s *ProjectsService) ArchiveProject(pid interface{}, options ...OptionFunc) (*Project, *Response, error)

ArchiveProject archives the project if the user is either admin or the project owner of this project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#archive-a-project

func (*ProjectsService) CreateProject

func (s *ProjectsService) CreateProject(opt *CreateProjectOptions, options ...OptionFunc) (*Project, *Response, error)

CreateProject creates a new project owned by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#create-project

func (*ProjectsService) CreateProjectForUser

func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUserOptions, options ...OptionFunc) (*Project, *Response, error)

CreateProjectForUser creates a new project owned by the specified user. Available only for admins.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#create-project-for-user

func (*ProjectsService) CreateProjectForkRelation

func (s *ProjectsService) CreateProjectForkRelation(pid int, fork int, options ...OptionFunc) (*ProjectForkRelation, *Response, error)

CreateProjectForkRelation creates a forked from/to relation between existing projects.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#create-a-forked-fromto-relation-between-existing-projects.

func (*ProjectsService) DeleteBuildTrigger

func (s *ProjectsService) DeleteBuildTrigger(pid interface{}, token string, options ...OptionFunc) (*Response, error)

DeleteBuildTrigger removes a trigger from a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_triggers.md#remove-a-project-trigger

func (*ProjectsService) DeleteProject

func (s *ProjectsService) DeleteProject(pid interface{}, options ...OptionFunc) (*Response, error)

DeleteProject removes a project including all associated resources (issues, merge requests etc.)

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#remove-project

func (*ProjectsService) DeleteProjectForkRelation

func (s *ProjectsService) DeleteProjectForkRelation(pid int, options ...OptionFunc) (*Response, error)

DeleteProjectForkRelation deletes an existing forked from relationship.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#delete-an-existing-forked-from-relationship

func (*ProjectsService) DeleteProjectHook

func (s *ProjectsService) DeleteProjectHook(pid interface{}, hook int, options ...OptionFunc) (*Response, error)

DeleteProjectHook removes a hook from a project. This is an idempotent method and can be called multiple times. Either the hook is available or not.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#delete-project-hook

func (*ProjectsService) DeleteProjectMember

func (s *ProjectsService) DeleteProjectMember(pid interface{}, user int, options ...OptionFunc) (*Response, error)

DeleteProjectMember removes a user from a project team.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#remove-project-team-member

func (*ProjectsService) EditProject

func (s *ProjectsService) EditProject(pid interface{}, opt *EditProjectOptions, options ...OptionFunc) (*Project, *Response, error)

EditProject updates an existing project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#edit-project

func (*ProjectsService) EditProjectHook

func (s *ProjectsService) EditProjectHook(pid interface{}, hook int, opt *EditProjectHookOptions, options ...OptionFunc) (*ProjectHook, *Response, error)

EditProjectHook edits a hook for a specified project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#edit-project-hook

func (*ProjectsService) EditProjectMember

func (s *ProjectsService) EditProjectMember(pid interface{}, user int, opt *EditProjectMemberOptions, options ...OptionFunc) (*ProjectMember, *Response, error)

EditProjectMember updates a project team member to a specified access level..

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#edit-project-team-member

func (*ProjectsService) ForkProject

func (s *ProjectsService) ForkProject(pid interface{}, options ...OptionFunc) (*Project, *Response, error)

ForkProject forks a project into the user namespace of the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#fork-project

func (*ProjectsService) GetBuildTrigger

func (s *ProjectsService) GetBuildTrigger(pid interface{}, token string, options ...OptionFunc) (*BuildTrigger, *Response, error)

GetBuildTrigger gets a specific build trigger for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_triggers.md#get-trigger-details

func (*ProjectsService) GetProject

func (s *ProjectsService) GetProject(pid interface{}, options ...OptionFunc) (*Project, *Response, error)

GetProject gets a specific project, identified by project ID or NAMESPACE/PROJECT_NAME, which is owned by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#get-single-project

func (*ProjectsService) GetProjectEvents

func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEventsOptions, options ...OptionFunc) ([]*ProjectEvent, *Response, error)

GetProjectEvents gets the events for the specified project. Sorted from newest to latest.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#get-project-events

func (*ProjectsService) GetProjectHook

func (s *ProjectsService) GetProjectHook(pid interface{}, hook int, options ...OptionFunc) (*ProjectHook, *Response, error)

GetProjectHook gets a specific hook for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#get-project-hook

func (*ProjectsService) GetProjectMember

func (s *ProjectsService) GetProjectMember(pid interface{}, user int, options ...OptionFunc) (*ProjectMember, *Response, error)

GetProjectMember gets a project team member.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#get-project-team-member

func (*ProjectsService) ListAllProjects

func (s *ProjectsService) ListAllProjects(opt *ListProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

ListAllProjects gets a list of all GitLab projects (admin only).

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-all-projects

func (*ProjectsService) ListBuildTriggers

func (s *ProjectsService) ListBuildTriggers(pid interface{}, opt *ListBuildTriggersOptions, options ...OptionFunc) ([]*BuildTrigger, *Response, error)

ListBuildTriggers gets a list of project triggers.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/build_triggers.md#list-project-triggers

func (*ProjectsService) ListOwnedProjects

func (s *ProjectsService) ListOwnedProjects(opt *ListProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

ListOwnedProjects gets a list of projects which are owned by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-owned-projects

func (*ProjectsService) ListProjectHooks

func (s *ProjectsService) ListProjectHooks(pid interface{}, opt *ListProjectHooksOptions, options ...OptionFunc) ([]*ProjectHook, *Response, error)

ListProjectHooks gets a list of project hooks.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-project-hooks

func (*ProjectsService) ListProjectMembers

func (s *ProjectsService) ListProjectMembers(pid interface{}, opt *ListProjectMembersOptions, options ...OptionFunc) ([]*ProjectMember, *Response, error)

ListProjectMembers gets a list of a project's team members.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-project-team-members

func (*ProjectsService) ListProjects

func (s *ProjectsService) ListProjects(opt *ListProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

ListProjects gets a list of projects for which the authenticated user is a member

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-projects

func (*ProjectsService) ListStarredProjects

func (s *ProjectsService) ListStarredProjects(opt *ListProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

ListStarredProjects gets a list of projects which are starred by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-starred-projects

func (*ProjectsService) ListVisibleProjects

func (s *ProjectsService) ListVisibleProjects(opt *ListProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

ListVisibleProjects gets a list of projects accessible by the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-projects

func (*ProjectsService) SearchProjects

func (s *ProjectsService) SearchProjects(query string, opt *SearchProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error)

SearchProjects searches for projects by name which are accessible to the authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#search-for-projects-by-name

func (*ProjectsService) UnarchiveProject

func (s *ProjectsService) UnarchiveProject(pid interface{}, options ...OptionFunc) (*Project, *Response, error)

UnarchiveProject unarchives the project if the user is either admin or the project owner of this project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#unarchive-a-project

type ProtectBranchOptions

type ProtectBranchOptions struct {
	DevelopersCanPush  *bool `url:"developers_can_push,omitempty" json:"developers_can_push,omitempty"`
	DevelopersCanMerge *bool `url:"developers_can_merge,omitempty" json:"developers_can_merge,omitempty"`
}

ProtectBranchOptions represents the available ProtectBranch() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/branches.md#protect-repository-branch

type PushEvent

type PushEvent struct {
	ObjectKind  string `json:"object_kind"`
	Before      string `json:"before"`
	After       string `json:"after"`
	Ref         string `json:"ref"`
	CheckoutSha string `json:"checkout_sha"`
	UserID      int    `json:"user_id"`
	UserName    string `json:"user_name"`
	UserEmail   string `json:"user_email"`
	UserAvatar  string `json:"user_avatar"`
	ProjectID   int    `json:"project_id"`
	Project     struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository        *Repository `json:"repository"`
	Commits           []*Commit   `json:"commits"`
	TotalCommitsCount int         `json:"total_commits_count"`
}

PushEvent represents a push event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#push-events

type RawFileContentOptions

type RawFileContentOptions struct {
	FilePath *string `url:"filepath,omitempty" json:"filepath,omitempty"`
}

RawFileContentOptions represents the available RawFileContent() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#raw-file-content

type RepositoriesService

type RepositoriesService struct {
	// contains filtered or unexported fields
}

RepositoriesService handles communication with the repositories related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md

func (*RepositoriesService) Archive

func (s *RepositoriesService) Archive(pid interface{}, opt *ArchiveOptions, options ...OptionFunc) ([]byte, *Response, error)

Archive gets an archive of the repository.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#get-file-archive

func (*RepositoriesService) Compare

func (s *RepositoriesService) Compare(pid interface{}, opt *CompareOptions, options ...OptionFunc) (*Compare, *Response, error)

Compare compares branches, tags or commits.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#compare-branches-tags-or-commits

func (*RepositoriesService) Contributors

func (s *RepositoriesService) Contributors(pid interface{}, options ...OptionFunc) ([]*Contributor, *Response, error)

Contributors gets the repository contributors list.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#contributer

func (*RepositoriesService) ListTree

func (s *RepositoriesService) ListTree(pid interface{}, opt *ListTreeOptions, options ...OptionFunc) ([]*TreeNode, *Response, error)

ListTree gets a list of repository files and directories in a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#list-repository-tree

func (*RepositoriesService) RawBlobContent

func (s *RepositoriesService) RawBlobContent(pid interface{}, sha string, options ...OptionFunc) ([]byte, *Response, error)

RawBlobContent gets the raw file contents for a blob by blob SHA.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#raw-blob-content

func (*RepositoriesService) RawFileContent

func (s *RepositoriesService) RawFileContent(pid interface{}, sha string, opt *RawFileContentOptions, options ...OptionFunc) ([]byte, *Response, error)

RawFileContent gets the raw file contents for a file by commit SHA and path

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md#raw-file-content

type Repository

type Repository struct {
	Name              string `json:"name"`
	Description       string `json:"description"`
	WebURL            string `json:"web_url"`
	AvatarURL         string `json:"avatar_url"`
	GitSSHURL         string `json:"git_ssh_url"`
	GitHTTPURL        string `json:"git_http_url"`
	Namespace         string `json:"namespace"`
	VisibilityLevel   int    `json:"visibility_level"`
	PathWithNamespace string `json:"path_with_namespace"`
	DefaultBranch     string `json:"default_branch"`
	Homepage          string `json:"homepage"`
	URL               string `json:"url"`
	SSHURL            string `json:"ssh_url"`
	HTTPURL           string `json:"http_url"`
}

Repository represents a repository.

type RepositoryFilesService

type RepositoryFilesService struct {
	// contains filtered or unexported fields
}

RepositoryFilesService handles communication with the repository files related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md

func (*RepositoryFilesService) CreateFile

func (s *RepositoryFilesService) CreateFile(pid interface{}, opt *CreateFileOptions, options ...OptionFunc) (*FileInfo, *Response, error)

CreateFile creates a new file in a repository.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#create-new-file-in-repository

func (*RepositoryFilesService) DeleteFile

func (s *RepositoryFilesService) DeleteFile(pid interface{}, opt *DeleteFileOptions, options ...OptionFunc) (*FileInfo, *Response, error)

DeleteFile deletes an existing file in a repository

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#delete-existing-file-in-repository

func (*RepositoryFilesService) GetFile

func (s *RepositoryFilesService) GetFile(pid interface{}, opt *GetFileOptions, options ...OptionFunc) (*File, *Response, error)

GetFile allows you to receive information about a file in repository like name, size, content. Note that file content is Base64 encoded.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#get-file-from-respository

func (*RepositoryFilesService) UpdateFile

func (s *RepositoryFilesService) UpdateFile(pid interface{}, opt *UpdateFileOptions, options ...OptionFunc) (*FileInfo, *Response, error)

UpdateFile updates an existing file in a repository

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#update-existing-file-in-repository

type Response

type Response struct {
	*http.Response

	NextPage  int
	PrevPage  int
	FirstPage int
	LastPage  int
}

Response is a GitLab API response. This wraps the standard http.Response returned from GitLab and provides convenient access to things like pagination links.

type SSHKey

type SSHKey struct {
	ID        int        `json:"id"`
	Title     string     `json:"title"`
	Key       string     `json:"key"`
	CreatedAt *time.Time `json:"created_at"`
}

SSHKey represents a SSH key.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-ssh-keys

type SearchProjectsOptions

type SearchProjectsOptions struct {
	ListOptions
	OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort    *string `url:"sort,omitempty" json:"sort,omitempty"`
}

SearchProjectsOptions represents the available SearchProjects() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#search-for-projects-by-name

type Service

type Service struct {
	ID                  *int       `json:"id"`
	Title               *string    `json:"title"`
	CreatedAt           *time.Time `json:"created_at"`
	UpdatedAt           *time.Time `json:"created_at"`
	Active              *bool      `json:"active"`
	PushEvents          *bool      `json:"push_events"`
	IssuesEvents        *bool      `json:"issues_events"`
	MergeRequestsEvents *bool      `json:"merge_requests_events"`
	TagPushEvents       *bool      `json:"tag_push_events"`
	NoteEvents          *bool      `json:"note_events"`
}

Service represents a GitLab service.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md

type ServicesService

type ServicesService struct {
	// contains filtered or unexported fields
}

ServicesService handles communication with the services related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md

func (*ServicesService) DeleteDroneCIService

func (s *ServicesService) DeleteDroneCIService(pid interface{}, options ...OptionFunc) (*Response, error)

DeleteDroneCIService deletes Drone CI service settings for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#delete-drone-ci-service

func (*ServicesService) DeleteGitLabCIService

func (s *ServicesService) DeleteGitLabCIService(pid interface{}, options ...OptionFunc) (*Response, error)

DeleteGitLabCIService deletes GitLab CI service settings for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#delete-gitlab-ci-service

func (*ServicesService) DeleteHipChatService

func (s *ServicesService) DeleteHipChatService(pid interface{}, options ...OptionFunc) (*Response, error)

DeleteHipChatService deletes HipChat service for project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#delete-hipchat-service

func (*ServicesService) DeleteSlackService

func (s *ServicesService) DeleteSlackService(pid interface{}, options ...OptionFunc) (*Response, error)

DeleteSlackService deletes Slack service for project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#delete-slack-service

func (*ServicesService) GetDroneCIService

func (s *ServicesService) GetDroneCIService(pid interface{}, options ...OptionFunc) (*DroneCIService, *Response, error)

GetDroneCIService gets Drone CI service settings for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#get-drone-ci-service-settings

func (*ServicesService) SetDroneCIService

func (s *ServicesService) SetDroneCIService(pid interface{}, opt *SetDroneCIServiceOptions, options ...OptionFunc) (*Response, error)

SetDroneCIService sets Drone CI service for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#createedit-drone-ci-service

func (*ServicesService) SetGitLabCIService

func (s *ServicesService) SetGitLabCIService(pid interface{}, opt *SetGitLabCIServiceOptions, options ...OptionFunc) (*Response, error)

SetGitLabCIService sets GitLab CI service for a project.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#edit-gitlab-ci-service

func (*ServicesService) SetHipChatService

func (s *ServicesService) SetHipChatService(pid interface{}, opt *SetHipChatServiceOptions, options ...OptionFunc) (*Response, error)

SetHipChatService sets HipChat service for a project

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#edit-hipchat-service

func (*ServicesService) SetSlackService

func (s *ServicesService) SetSlackService(pid interface{}, opt *SetSlackServiceOptions, options ...OptionFunc) (*Response, error)

SetSlackService sets Slack service for a project

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#edit-slack-service

type Session

type Session struct {
	ID               int         `json:"id"`
	Username         string      `json:"username"`
	Email            string      `json:"email"`
	Name             string      `json:"name"`
	PrivateToken     string      `json:"private_token"`
	Blocked          bool        `json:"blocked"`
	CreatedAt        *time.Time  `json:"created_at"`
	Bio              interface{} `json:"bio"`
	Skype            string      `json:"skype"`
	Linkedin         string      `json:"linkedin"`
	Twitter          string      `json:"twitter"`
	WebsiteURL       string      `json:"website_url"`
	DarkScheme       bool        `json:"dark_scheme"`
	ThemeID          int         `json:"theme_id"`
	IsAdmin          bool        `json:"is_admin"`
	CanCreateGroup   bool        `json:"can_create_group"`
	CanCreateTeam    bool        `json:"can_create_team"`
	CanCreateProject bool        `json:"can_create_project"`
}

Session represents a GitLab session.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/session.md#session

type SessionService

type SessionService struct {
	// contains filtered or unexported fields
}

SessionService handles communication with the session related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/session.md

func (*SessionService) GetSession

func (s *SessionService) GetSession(opt *GetSessionOptions, options ...OptionFunc) (*Session, *Response, error)

GetSession logs in to get private token.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/session.md#session

type SetCommitStatusOptions

type SetCommitStatusOptions struct {
	State       BuildState `url:"state" json:"state"`
	Ref         *string    `url:"ref,omitempty" json:"ref,omitempty"`
	Name        *string    `url:"name,omitempty" json:"name,omitempty"`
	Context     *string    `url:"context,omitempty" json:"context,omitempty"`
	TargetURL   *string    `url:"target_url,omitempty" json:"target_url,omitempty"`
	Description *string    `url:"description,omitempty" json:"description,omitempty"`
}

SetCommitStatusOptions represents the available SetCommitStatus() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/commits.md#post-the-status-to-commit

type SetDroneCIServiceOptions

type SetDroneCIServiceOptions struct {
	Token                 *string `url:"token" json:"token" `
	DroneURL              *string `url:"drone_url" json:"drone_url"`
	EnableSSLVerification *string `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
}

SetDroneCIServiceOptions represents the available SetDroneCIService() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#createedit-drone-ci-service

type SetGitLabCIServiceOptions

type SetGitLabCIServiceOptions struct {
	Token      *string `url:"token,omitempty" json:"token,omitempty"`
	ProjectURL *string `url:"project_url,omitempty" json:"project_url,omitempty"`
}

SetGitLabCIServiceOptions represents the available SetGitLabCIService() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#edit-gitlab-ci-service

type SetHipChatServiceOptions

type SetHipChatServiceOptions struct {
	Token *string `url:"token,omitempty" json:"token,omitempty" `
	Room  *string `url:"room,omitempty" json:"room,omitempty"`
}

SetHipChatServiceOptions represents the available SetHipChatService() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#edit-hipchat-service

type SetSlackServiceOptions

type SetSlackServiceOptions struct {
	WebHook  *string `url:"webhook,omitempty" json:"webhook,omitempty" `
	Username *string `url:"username,omitempty" json:"username,omitempty" `
	Channel  *string `url:"channel,omitempty" json:"channel,omitempty"`
}

SetSlackServiceOptions represents the available SetSlackService() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/services.md#edit-slack-service

type SetTimeEstimateOptions

type SetTimeEstimateOptions struct {
	Duration *string `url:"duration,omitempty" json:"duration,omitempty"`
}

SetTimeEstimateOptions represents the available SetTimeEstimate() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#set-a-time-estimate-for-an-issue

type Settings

type Settings struct {
	ID                         int                    `json:"id"`
	DefaultProjectsLimit       int                    `json:"default_projects_limit"`
	SignupEnabled              bool                   `json:"signup_enabled"`
	SigninEnabled              bool                   `json:"signin_enabled"`
	GravatarEnabled            bool                   `json:"gravatar_enabled"`
	SignInText                 string                 `json:"sign_in_text"`
	CreatedAt                  *time.Time             `json:"created_at"`
	UpdatedAt                  *time.Time             `json:"updated_at"`
	HomePageURL                string                 `json:"home_page_url"`
	DefaultBranchProtection    int                    `json:"default_branch_protection"`
	TwitterSharingEnabled      bool                   `json:"twitter_sharing_enabled"`
	RestrictedVisibilityLevels []VisibilityLevelValue `json:"restricted_visibility_levels"`
	MaxAttachmentSize          int                    `json:"max_attachment_size"`
	SessionExpireDelay         int                    `json:"session_expire_delay"`
	DefaultProjectVisibility   int                    `json:"default_project_visibility"`
	DefaultSnippetVisibility   int                    `json:"default_snippet_visibility"`
	RestrictedSignupDomains    []string               `json:"restricted_signup_domains"`
	UserOauthApplications      bool                   `json:"user_oauth_applications"`
	AfterSignOutPath           string                 `json:"after_sign_out_path"`
}

Settings represents the GitLab application settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md

func (Settings) String

func (s Settings) String() string

type SettingsService

type SettingsService struct {
	// contains filtered or unexported fields
}

SettingsService handles communication with the application SettingsService related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md

func (*SettingsService) GetSettings

func (s *SettingsService) GetSettings(options ...OptionFunc) (*Settings, *Response, error)

GetSettings gets the current application settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md#get-current-application.settings

func (*SettingsService) UpdateSettings

func (s *SettingsService) UpdateSettings(opt *UpdateSettingsOptions, options ...OptionFunc) (*Settings, *Response, error)

UpdateSettings updates the application settings.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md#change-application.settings

type Snippet

type Snippet struct {
	ID       int    `json:"id"`
	Title    string `json:"title"`
	FileName string `json:"file_name"`
	Author   struct {
		ID        int        `json:"id"`
		Username  string     `json:"username"`
		Email     string     `json:"email"`
		Name      string     `json:"name"`
		State     string     `json:"state"`
		CreatedAt *time.Time `json:"created_at"`
	} `json:"author"`
	ExpiresAt *time.Time `json:"expires_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	CreatedAt *time.Time `json:"created_at"`
}

Snippet represents a GitLab project snippet.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md

func (Snippet) String

func (s Snippet) String() string

type SnippetCommentEvent

type SnippetCommentEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	ProjectID  int    `json:"project_id"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository       *Repository `json:"repository"`
	ObjectAttributes struct {
		ID           int    `json:"id"`
		Note         string `json:"note"`
		NoteableType string `json:"noteable_type"`
		AuthorID     int    `json:"author_id"`
		CreatedAt    string `json:"created_at"`
		UpdatedAt    string `json:"updated_at"`
		ProjectID    int    `json:"project_id"`
		Attachment   string `json:"attachment"`
		LineCode     string `json:"line_code"`
		CommitID     string `json:"commit_id"`
		NoteableID   int    `json:"noteable_id"`
		System       bool   `json:"system"`
		StDiff       *Diff  `json:"st_diff"`
		URL          string `json:"url"`
	} `json:"object_attributes"`
	Snippet *Snippet `json:"snippet"`
}

SnippetCommentEvent represents a comment on a snippet event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#comment-on-code-snippet

type StorageStatistics

type StorageStatistics struct {
	StorageSize        int64 `json:"storage_size"`
	RepositorySize     int64 `json:"repository_size"`
	LfsObjectsSize     int64 `json:"lfs_objects_size"`
	BuildArtifactsSize int64 `json:"build_artifacts_size"`
}

StorageStatistics represents a statistics record for a group or project.

type SystemHooksService

type SystemHooksService struct {
	// contains filtered or unexported fields
}

SystemHooksService handles communication with the system hooks related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md

func (*SystemHooksService) AddHook

func (s *SystemHooksService) AddHook(opt *AddHookOptions, options ...OptionFunc) (*Hook, *Response, error)

AddHook adds a new system hook hook.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md#add-new-system-hook-hook

func (*SystemHooksService) DeleteHook

func (s *SystemHooksService) DeleteHook(hook int, options ...OptionFunc) (*Response, error)

DeleteHook deletes a system hook. This is an idempotent API function and returns 200 OK even if the hook is not available. If the hook is deleted it is also returned as JSON.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md#delete-system-hook

func (*SystemHooksService) ListHooks

func (s *SystemHooksService) ListHooks(options ...OptionFunc) ([]*Hook, *Response, error)

ListHooks gets a list of system hooks.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md#list-system-hooks

func (*SystemHooksService) TestHook

func (s *SystemHooksService) TestHook(hook int, options ...OptionFunc) (*HookEvent, *Response, error)

TestHook tests a system hook.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/system_hooks.md#test-system-hook

type Tag

type Tag struct {
	Commit  *Commit `json:"commit"`
	Release struct {
		TagName     string `json:"tag_name"`
		Description string `json:"description"`
	} `json:"release"`
	Name    string `json:"name"`
	Message string `json:"message"`
}

Tag represents a GitLab tag.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md

func (Tag) String

func (t Tag) String() string

type TagEvent

type TagEvent struct {
	ObjectKind  string `json:"object_kind"`
	Before      string `json:"before"`
	After       string `json:"after"`
	Ref         string `json:"ref"`
	CheckoutSha string `json:"checkout_sha"`
	UserID      int    `json:"user_id"`
	UserName    string `json:"user_name"`
	UserAvatar  string `json:"user_avatar"`
	ProjectID   int    `json:"project_id"`
	Project     struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Repository        *Repository `json:"repository"`
	Commits           []*Commit   `json:"commits"`
	TotalCommitsCount int         `json:"total_commits_count"`
}

TagEvent represents a tag event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#tag-events

type TagsService

type TagsService struct {
	// contains filtered or unexported fields
}

TagsService handles communication with the tags related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md

func (*TagsService) CreateTag

func (s *TagsService) CreateTag(pid interface{}, opt *CreateTagOptions, options ...OptionFunc) (*Tag, *Response, error)

CreateTag creates a new tag in the repository that points to the supplied ref.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md#create-a-new-tag

func (*TagsService) DeleteTag

func (s *TagsService) DeleteTag(pid interface{}, tag string, options ...OptionFunc) (*Response, error)

DeleteTag deletes a tag of a repository with given name.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md#delete-a-tag

func (*TagsService) GetTag

func (s *TagsService) GetTag(pid interface{}, tag string, options ...OptionFunc) (*Tag, *Response, error)

GetTag a specific repository tag determined by its name. It returns 200 together with the tag information if the tag exists. It returns 404 if the tag does not exist.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md#get-a-single-repository-tag

func (*TagsService) ListTags

func (s *TagsService) ListTags(pid interface{}, options ...OptionFunc) ([]*Tag, *Response, error)

ListTags gets a list of tags from a project, sorted by name in reverse alphabetical order.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/tags.md#list-project-repository-tags

type TimeStats

type TimeStats struct {
	HumanTimeEstimate   string `json:"human_time_estimate"`
	HumanTotalTimeSpent string `json:"human_total_time_spent"`
	TimeEstimate        int    `json:"time_estimate"`
	TotalTimeSpent      int    `json:"total_time_spent"`
}

TimeStats represents the time estimates and time spent for an issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md

func (TimeStats) String

func (t TimeStats) String() string

type TimeStatsService

type TimeStatsService struct {
	// contains filtered or unexported fields
}

TimeStatsService handles communication with the time tracking related methods of the GitLab API.

GitLab docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/workflow/time_tracking.md GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md

func (*TimeStatsService) AddSpentTime

func (s *TimeStatsService) AddSpentTime(pid interface{}, issue int, opt *AddSpentTimeOptions, options ...OptionFunc) (*TimeStats, *Response, error)

AddSpentTime adds spent time for a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#add-spent-time-for-an-issue

func (*TimeStatsService) GetTimeSpent

func (s *TimeStatsService) GetTimeSpent(pid interface{}, issue int, options ...OptionFunc) (*TimeStats, *Response, error)

GetTimeSpent gets the spent time for a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#get-time-tracking-stats

func (*TimeStatsService) ResetSpentTime

func (s *TimeStatsService) ResetSpentTime(pid interface{}, issue int, options ...OptionFunc) (*TimeStats, *Response, error)

ResetSpentTime resets the spent time for a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#reset-spent-time-for-an-issue

func (*TimeStatsService) ResetTimeEstimate

func (s *TimeStatsService) ResetTimeEstimate(pid interface{}, issue int, options ...OptionFunc) (*TimeStats, *Response, error)

ResetTimeEstimate resets the time estimate for a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#reset-the-time-estimate-for-an-issue

func (*TimeStatsService) SetTimeEstimate

func (s *TimeStatsService) SetTimeEstimate(pid interface{}, issue int, opt *SetTimeEstimateOptions, options ...OptionFunc) (*TimeStats, *Response, error)

SetTimeEstimate sets the time estimate for a single project issue.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#set-a-time-estimate-for-an-issue

type TreeNode

type TreeNode struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	Path string `json:"path"`
	Mode string `json:"mode"`
}

TreeNode represents a GitLab repository file or directory.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md

func (TreeNode) String

func (t TreeNode) String() string

type UpdateFileOptions

type UpdateFileOptions struct {
	FilePath      *string `url:"file_path,omitempty" json:"file_path,omitempty"`
	BranchName    *string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
	Encoding      *string `url:"encoding,omitempty" json:"encoding,omitempty"`
	AuthorEmail   *string `url:"author_email,omitempty" json:"author_email,omitempty"`
	AuthorName    *string `url:"author_name,omitempty" json:"author_name,omitempty"`
	Content       *string `url:"content,omitempty" json:"content,omitempty"`
	CommitMessage *string `url:"commit_message,omitempty" json:"commit_message,omitempty"`
}

UpdateFileOptions represents the available UpdateFile() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repository_files.md#update-existing-file-in-repository

type UpdateGroupMemberOptions

type UpdateGroupMemberOptions struct {
	AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
}

UpdateGroupMemberOptions represents the available UpdateGroupMember() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#edit-group-team-member

type UpdateGroupOptions

type UpdateGroupOptions CreateGroupOptions

UpdateGroupOptions represents the set of available options to update a Group; as of today these are exactly the same available when creating a new Group.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/groups.md#update-group

type UpdateIssueNoteOptions

type UpdateIssueNoteOptions struct {
	Body *string `url:"body,omitempty" json:"body,omitempty"`
}

UpdateIssueNoteOptions represents the available UpdateIssueNote() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#modify-existing-issue-note

type UpdateIssueOptions

type UpdateIssueOptions struct {
	Title       *string `url:"title,omitempty" json:"title,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
	AssigneeID  *int    `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	MilestoneID *int    `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
	Labels      Labels  `url:"labels,comma,omitempty" json:"labels,omitempty"`
	StateEvent  *string `url:"state_event,omitempty" json:"state_event,omitempty"`
}

UpdateIssueOptions represents the available UpdateIssue() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/issues.md#edit-issues

type UpdateLabelOptions

type UpdateLabelOptions struct {
	Name        *string `url:"name,omitempty" json:"name,omitempty"`
	NewName     *string `url:"new_name,omitempty" json:"new_name,omitempty"`
	Color       *string `url:"color,omitempty" json:"color,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
}

UpdateLabelOptions represents the available UpdateLabel() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/labels.md#delete-a-label

type UpdateMergeRequestNoteOptions

type UpdateMergeRequestNoteOptions struct {
	Body *string `url:"body,omitempty" json:"body,omitempty"`
}

UpdateMergeRequestNoteOptions represents the available UpdateMergeRequestNote() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#modify-existing-merge-request-note

type UpdateMergeRequestOptions

type UpdateMergeRequestOptions struct {
	Title        *string `url:"title,omitempty" json:"title,omitempty"`
	Description  *string `url:"description,omitempty" json:"description,omitempty"`
	TargetBranch *string `url:"target_branch,omitemtpy" json:"target_branch,omitemtpy"`
	AssigneeID   *int    `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	StateEvent   *string `url:"state_event,omitempty" json:"state_event,omitempty"`
}

UpdateMergeRequestOptions represents the available UpdateMergeRequest() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/merge_requests.md#update-mr

type UpdateMilestoneOptions

type UpdateMilestoneOptions struct {
	Title       *string `url:"title,omitempty" json:"title,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
	StartDate   *string `url:"start_date,omitempty" json:"start_date,omitempty"`
	DueDate     *string `url:"due_date,omitempty" json:"due_date,omitempty"`
	StateEvent  *string `url:"state_event,omitempty" json:"state_event,omitempty"`
}

UpdateMilestoneOptions represents the available UpdateMilestone() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#edit-milestone

type UpdateSettingsOptions

type UpdateSettingsOptions struct {
	DefaultProjectsLimit       *int                   `url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"`
	SignupEnabled              *bool                  `url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"`
	SigninEnabled              *bool                  `url:"signin_enabled,omitempty" json:"signin_enabled,omitempty"`
	GravatarEnabled            *bool                  `url:"gravatar_enabled,omitempty" json:"gravatar_enabled,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"`
	DefaultBranchProtection    *int                   `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"`
	TwitterSharingEnabled      *bool                  `url:"twitter_sharing_enabled,omitempty" json:"twitter_sharing_enabled,omitempty"`
	RestrictedVisibilityLevels []VisibilityLevelValue `url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,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"`
	DefaultProjectVisibility   *int                   `url:"default_project_visibility,omitempty" json:"default_project_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"`
	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"`
}

UpdateSettingsOptions represents the available UpdateSettings() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/settings.md#change-application.settings

type UpdateSnippetNoteOptions

type UpdateSnippetNoteOptions struct {
	Body *string `url:"body,omitempty" json:"body,omitempty"`
}

UpdateSnippetNoteOptions represents the available UpdateSnippetNote() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/notes.md#modify-existing-snippet-note

type UpdateSnippetOptions

type UpdateSnippetOptions struct {
	Title           *string               `url:"title,omitempty" json:"title,omitempty"`
	FileName        *string               `url:"file_name,omitempty" json:"file_name,omitempty"`
	Code            *string               `url:"code,omitempty" json:"code,omitempty"`
	VisibilityLevel *VisibilityLevelValue `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
}

UpdateSnippetOptions represents the available UpdateSnippet() options.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/project_snippets.md#update-snippet

type User

type User struct {
	ID               int             `json:"id"`
	Username         string          `json:"username"`
	Email            string          `json:"email"`
	Name             string          `json:"name"`
	State            string          `json:"state"`
	CreatedAt        *time.Time      `json:"created_at"`
	Bio              string          `json:"bio"`
	Skype            string          `json:"skype"`
	Linkedin         string          `json:"linkedin"`
	Twitter          string          `json:"twitter"`
	WebsiteURL       string          `json:"website_url"`
	ExternUID        string          `json:"extern_uid"`
	Provider         string          `json:"provider"`
	ThemeID          int             `json:"theme_id"`
	ColorSchemeID    int             `json:"color_scheme_id"`
	IsAdmin          bool            `json:"is_admin"`
	AvatarURL        string          `json:"avatar_url"`
	CanCreateGroup   bool            `json:"can_create_group"`
	CanCreateProject bool            `json:"can_create_project"`
	ProjectsLimit    int             `json:"projects_limit"`
	CurrentSignInAt  *time.Time      `json:"current_sign_in_at"`
	LastSignInAt     *time.Time      `json:"last_sign_in_at"`
	TwoFactorEnabled bool            `json:"two_factor_enabled"`
	Identities       []*UserIdentity `json:"identities"`
}

User represents a GitLab user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md

type UserIdentity

type UserIdentity struct {
	Provider  string `json:"provider"`
	ExternUID string `json:"extern_uid"`
}

UserIdentity represents a user identity

type UsersService

type UsersService struct {
	// contains filtered or unexported fields
}

UsersService handles communication with the user related methods of the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md

func (*UsersService) AddEmail

func (s *UsersService) AddEmail(opt *AddEmailOptions, options ...OptionFunc) (*Email, *Response, error)

AddEmail creates a new email owned by the currently authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#add-email

func (*UsersService) AddEmailForUser

func (s *UsersService) AddEmailForUser(uid int, opt *AddEmailOptions, options ...OptionFunc) (*Email, *Response, error)

AddEmailForUser creates new email owned by specified user. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#add-email-for-user

func (*UsersService) AddSSHKey

func (s *UsersService) AddSSHKey(opt *AddSSHKeyOptions, options ...OptionFunc) (*SSHKey, *Response, error)

AddSSHKey creates a new key owned by the currently authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#add-ssh-key

func (*UsersService) AddSSHKeyForUser

func (s *UsersService) AddSSHKeyForUser(user int, opt *AddSSHKeyOptions, options ...OptionFunc) (*SSHKey, *Response, error)

AddSSHKeyForUser creates new key owned by specified user. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#add-ssh-key-for-user

func (*UsersService) BlockUser

func (s *UsersService) BlockUser(user int, options ...OptionFunc) error

BlockUser blocks the specified user. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#block-user

func (*UsersService) CreateUser

func (s *UsersService) CreateUser(opt *CreateUserOptions, options ...OptionFunc) (*User, *Response, error)

CreateUser creates a new user. Note only administrators can create new users.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#user-creation

func (*UsersService) CurrentUser

func (s *UsersService) CurrentUser(options ...OptionFunc) (*User, *Response, error)

CurrentUser gets currently authenticated user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#current-user

func (*UsersService) DeleteEmail

func (s *UsersService) DeleteEmail(eid int, options ...OptionFunc) (*Response, error)

DeleteEmail deletes email owned by currently authenticated user. This is an idempotent function and calling it on a key that is already deleted or not available results in 200 OK.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#delete-email-for-current-owner

func (*UsersService) DeleteEmailForUser

func (s *UsersService) DeleteEmailForUser(uid int, eid int, options ...OptionFunc) (*Response, error)

DeleteEmailForUser deletes email owned by a specified user. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#delete-email-for-given-user

func (*UsersService) DeleteSSHKey

func (s *UsersService) DeleteSSHKey(kid int, options ...OptionFunc) (*Response, error)

DeleteSSHKey deletes key owned by currently authenticated user. This is an idempotent function and calling it on a key that is already deleted or not available results in 200 OK.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#delete-ssh-key-for-current-owner

func (*UsersService) DeleteSSHKeyForUser

func (s *UsersService) DeleteSSHKeyForUser(user int, kid int, options ...OptionFunc) (*Response, error)

DeleteSSHKeyForUser deletes key owned by a specified user. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#delete-ssh-key-for-given-user

func (*UsersService) DeleteUser

func (s *UsersService) DeleteUser(user int, options ...OptionFunc) (*Response, error)

DeleteUser deletes a user. Available only for administrators. This is an idempotent function, calling this function for a non-existent user id still returns a status code 200 OK. The JSON response differs if the user was actually deleted or not. In the former the user is returned and in the latter not.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#user-deletion

func (*UsersService) GetEmail

func (s *UsersService) GetEmail(eid int, options ...OptionFunc) (*Email, *Response, error)

GetEmail gets a single email.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#single-email

func (*UsersService) GetSSHKey

func (s *UsersService) GetSSHKey(kid int, options ...OptionFunc) (*SSHKey, *Response, error)

GetSSHKey gets a single key.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#single-ssh-key

func (*UsersService) GetUser

func (s *UsersService) GetUser(user int, options ...OptionFunc) (*User, *Response, error)

GetUser gets a single user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#single-user

func (*UsersService) ListEmails

func (s *UsersService) ListEmails(options ...OptionFunc) ([]*Email, *Response, error)

ListEmails gets a list of currently authenticated user's Emails.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-emails

func (*UsersService) ListEmailsForUser

func (s *UsersService) ListEmailsForUser(uid int, options ...OptionFunc) ([]*Email, *Response, error)

ListEmailsForUser gets a list of a specified user's Emails. Available only for admin

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-emails-for-user

func (*UsersService) ListSSHKeys

func (s *UsersService) ListSSHKeys(options ...OptionFunc) ([]*SSHKey, *Response, error)

ListSSHKeys gets a list of currently authenticated user's SSH keys.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-ssh-keys

func (*UsersService) ListSSHKeysForUser

func (s *UsersService) ListSSHKeysForUser(user int, options ...OptionFunc) ([]*SSHKey, *Response, error)

ListSSHKeysForUser gets a list of a specified user's SSH keys. Available only for admin

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-ssh-keys-for-user

func (*UsersService) ListUsers

func (s *UsersService) ListUsers(opt *ListUsersOptions, options ...OptionFunc) ([]*User, *Response, error)

ListUsers gets a list of users.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#list-users

func (*UsersService) ModifyUser

func (s *UsersService) ModifyUser(user int, opt *ModifyUserOptions, options ...OptionFunc) (*User, *Response, error)

ModifyUser modifies an existing user. Only administrators can change attributes of a user.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#user-modification

func (*UsersService) UnblockUser

func (s *UsersService) UnblockUser(user int, options ...OptionFunc) error

UnblockUser unblocks the specified user. Available only for admin.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/users.md#unblock-user

type Version

type Version struct {
	Version  string `json:"version"`
	Revision string `json:"revision"`
}

Version represents a GitLab instance version.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/version.md

func (Version) String

func (s Version) String() string

type VersionService

type VersionService struct {
	// contains filtered or unexported fields
}

VersionService handles communication with the GitLab server instance to retrieve its version information via the GitLab API.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/version.md

func (*VersionService) GetVersion

func (s *VersionService) GetVersion() (*Version, *Response, error)

GetVersion gets a GitLab server instance version; it is only available to authenticated users.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/version.md

type VisibilityLevelValue

type VisibilityLevelValue int

VisibilityLevelValue represents a visibility level within GitLab.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/

const (
	PrivateVisibility  VisibilityLevelValue = 0
	InternalVisibility VisibilityLevelValue = 10
	PublicVisibility   VisibilityLevelValue = 20
)

List of available visibility levels

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/

func VisibilityLevel

func VisibilityLevel(v VisibilityLevelValue) *VisibilityLevelValue

VisibilityLevel is a helper routine that allocates a new VisibilityLevelValue to store v and returns a pointer to it.

type WikiPageEvent

type WikiPageEvent struct {
	ObjectKind string `json:"object_kind"`
	User       *User  `json:"user"`
	Project    struct {
		Name              string               `json:"name"`
		Description       string               `json:"description"`
		AvatarURL         string               `json:"avatar_url"`
		GitSSHURL         string               `json:"git_ssh_url"`
		GitHTTPURL        string               `json:"git_http_url"`
		Namespace         string               `json:"namespace"`
		PathWithNamespace string               `json:"path_with_namespace"`
		DefaultBranch     string               `json:"default_branch"`
		Homepage          string               `json:"homepage"`
		URL               string               `json:"url"`
		SSHURL            string               `json:"ssh_url"`
		HTTPURL           string               `json:"http_url"`
		WebURL            string               `json:"web_url"`
		VisibilityLevel   VisibilityLevelValue `json:"visibility_level"`
	} `json:"project"`
	Wiki struct {
		WebURL            string `json:"web_url"`
		GitSSHURL         string `json:"git_ssh_url"`
		GitHTTPURL        string `json:"git_http_url"`
		PathWithNamespace string `json:"path_with_namespace"`
		DefaultBranch     string `json:"default_branch"`
	} `json:"wiki"`
	ObjectAttributes struct {
		Title   string `json:"title"`
		Content string `json:"content"`
		Format  string `json:"format"`
		Message string `json:"message"`
		Slug    string `json:"slug"`
		URL     string `json:"url"`
		Action  string `json:"action"`
	} `json:"object_attributes"`
}

WikiPageEvent represents a wiki page event.

GitLab API docs: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/web_hooks/web_hooks.md#wiki-page-events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL