gitlab

package
v2.0.0-beta.3+incompat... Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package github implements a simple client to consume gitlab API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptMergeRequestRequest

type AcceptMergeRequestRequest struct {
	MergeCommitMessage       string `json:"merge_commit_message,omitempty"`
	ShouldRemoveSourceBranch bool   `json:"should_remove_source_branch,omitempty"`
	MergedWhenBuildSucceeds  bool   `json:"merged_when_build_succeeds,omitempty"`
}

type AccessLevelInfo

type AccessLevelInfo struct {
	AccessLevel            int    `json:"access_level,omitempty"`
	AccessLevelDescription string `json:"access_level_description,omitempty"`
	GroupId                int    `json:"group_id,omitempty"`
	UserId                 int    `json:"user_id,omitempty"`
}

type ActivityFeed

type ActivityFeed struct {
	Title   string        `xml:"title" json:"title"`
	Id      string        `xml:"id" json:"id"`
	Link    []Link        `xml:"link" json:"link"`
	Updated time.Time     `xml:"updated,attr" json:"updated"`
	Entries []*FeedCommit `xml:"entry" json:"entries"`
}

type AddMergeRequestRequest

type AddMergeRequestRequest struct {
	SourceBranch    string   `json:"source_branch"`
	TargetBranch    string   `json:"target_branch"`
	AssigneeId      int      `json:"assignee_id,omitempty"`
	Title           string   `json:"title"`
	Description     string   `json:"description,omitempty"`
	TargetProjectId int      `json:"target_project_id,omitempty"`
	Lables          []string `json:"lables,omitempty"`
}

type ArtifactsFile

type ArtifactsFile struct {
	Filename string `json:"filename"`
	Size     int    `json:"size"`
}

type Badge

type Badge struct {
	Id               int    `json:"id"`
	LinkUrl          string `json:"link_url"`
	ImageUrl         string `json:"image_url"`
	RenderedLinkUrl  string `json:"rendered_link_url"`
	RenderedImageUrl string `json:"rendered_image_url"`
	Kind             string `json:"kind"`
}

type Branch

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

type BranchCommit

type BranchCommit struct {
	Id               string  `json:"id,omitempty"`
	Tree             string  `json:"tree,omitempty"`
	AuthoredDateRaw  string  `json:"authored_date,omitempty"`
	CommittedDateRaw string  `json:"committed_date,omitempty"`
	Message          string  `json:"message,omitempty"`
	Author           *Person `json:"author,omitempty"`
	Committer        *Person `json:"committer,omitempty"`
}

type BranchesOptions

type BranchesOptions struct {
	PaginationOptions
	Search string // Return list of branches matching the search criteria
}

type Build

type Build struct {
	Id            int           `json:"id"`
	ArtifactsFile ArtifactsFile `json:"artifacts_file"`
	Commit        Commit        `json:"commit,omitempty"`
	CreatedAt     string        `json:"created_at"`
	DownloadURL   string        `json:"download_url"`
	FinishedAt    string        `json:"finished_at"`
	Name          string        `json:"name"`
	Ref           string        `json:"ref"`
	Stage         string        `json:"stage"`
	StartedAt     string        `json:"started_at"`
	Status        string        `json:"status"`
	Tag           bool          `json:"tag"`
	User          User          `json:"user"`
	When          string        `json:"when,omitempty"`
	Manual        bool          `json:"manual,omitempty"`
}

type ChangeItem

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

type Commit

type Commit struct {
	Id           string
	Short_Id     string
	Title        string
	Author_Name  string
	Author_Email string
	Created_At   string
	CreatedAt    time.Time
	Message      string
}

type CommitStatus

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

type FeedCommit

type FeedCommit struct {
	Id      string    `xml:"id" json:"id"`
	Title   string    `xml:"title" json:"title"`
	Link    []Link    `xml:"link" json:"link"`
	Updated time.Time `xml:"updated" json:"updated"`
	Author  Person    `xml:"author" json:"author"`
	Summary string    `xml:"summary" json:"summary"`
}

type Gitlab

type Gitlab struct {
	BaseUrl      string
	ApiPath      string
	RepoFeedPath string
	Token        string
	Client       *http.Client
}

func NewGitlab

func NewGitlab(baseUrl, apiPath, token string) *Gitlab

func (*Gitlab) Activity

func (g *Gitlab) Activity() (ActivityFeed, error)

func (*Gitlab) AddGroup

func (g *Gitlab) AddGroup(group *GroupAddPayload) (*GroupWithDetails, *ResponseMeta, error)

func (*Gitlab) AddGroupVariable

func (g *Gitlab) AddGroupVariable(groupId string, variable *Variable) (*Variable, *ResponseMeta, error)

func (*Gitlab) AddIssue

func (g *Gitlab) AddIssue(projectId string, req *IssueRequest) (issue *Issue, meta *ResponseMeta, err error)

func (*Gitlab) AddKey

func (g *Gitlab) AddKey(title, key string) (*ResponseMeta, error)

func (*Gitlab) AddMergeRequest

func (g *Gitlab) AddMergeRequest(req *AddMergeRequestRequest) (*MergeRequest, error)

Creates a new merge request.

POST /projects/:id/merge_requests

Parameters:

id               The ID of a project

func (*Gitlab) AddProject

func (g *Gitlab) AddProject(project *ProjectAddPayload) (*Project, *ResponseMeta, error)

func (*Gitlab) AddProjectBadge

func (g *Gitlab) AddProjectBadge(projectId string, badge *Badge) (*Badge, *ResponseMeta, error)

func (*Gitlab) AddProjectBranch

func (g *Gitlab) AddProjectBranch(projectId string, branchName, ref string) (*Branch, *ResponseMeta, error)

func (*Gitlab) AddProjectDeployKey

func (g *Gitlab) AddProjectDeployKey(id, title, key string) (*ResponseMeta, error)

Add deploy key to project.

POST /projects/:id/keys

Parameters:

id    The ID of a project
title The key title
key   The key value

func (*Gitlab) AddProjectHook

func (g *Gitlab) AddProjectHook(projectId string, hook *HookAddPayload) (*Hook, *ResponseMeta, error)

func (*Gitlab) AddProjectVariable

func (g *Gitlab) AddProjectVariable(projectId string, variable *Variable) (*Variable, *ResponseMeta, error)

func (*Gitlab) AddUserKey

func (g *Gitlab) AddUserKey(id, title, key string) (*ResponseMeta, error)

func (*Gitlab) AggregateJobs

func (g *Gitlab) AggregateJobs(jobs []*Job) map[int]map[string]map[string][]*Job

Aggregate jobs by:

  • pipeline
  • stage
  • job name

The resulting aggregation can be used to built something similar as the GitLab's UI used to display pipeline details.

func (*Gitlab) CancelProjectJob

func (g *Gitlab) CancelProjectJob(projectId string, jobId int) (*Job, *ResponseMeta, error)

func (*Gitlab) CurrentUser

func (g *Gitlab) CurrentUser() (*User, *ResponseMeta, error)

func (*Gitlab) DeleteKey

func (g *Gitlab) DeleteKey(id string) error

func (*Gitlab) DeleteRunner

func (g *Gitlab) DeleteRunner(id int) (*Runner, *ResponseMeta, error)

func (*Gitlab) DisableProjectRunner

func (g *Gitlab) DisableProjectRunner(projectId string, id int) (*Runner, *ResponseMeta, error)

func (*Gitlab) EditMergeRequest

func (g *Gitlab) EditMergeRequest(mr *MergeRequest) error

Updates an existing merge request.

PUT /projects/:id/merge_request/:merge_request_id

Parameters:

id               The ID of a project

func (*Gitlab) EnableProjectRunner

func (g *Gitlab) EnableProjectRunner(projectId string, id int) (*Runner, *ResponseMeta, error)

func (*Gitlab) EraseProjectJob

func (g *Gitlab) EraseProjectJob(projectId string, jobId int) (*Job, *ResponseMeta, error)

func (*Gitlab) Group

func (g *Gitlab) Group(id string, withCustomAttributes bool) (*GroupWithDetails, *ResponseMeta, error)

func (*Gitlab) GroupMembers

func (g *Gitlab) GroupMembers(groupId string, o *MembersOptions) ([]*Member, *ResponseMeta, error)

func (*Gitlab) GroupMergeRequests

func (g *Gitlab) GroupMergeRequests(groupId int, o *MergeRequestsOptions) ([]*MergeRequest, *ResponseMeta, error)

func (*Gitlab) GroupProjects

func (g *Gitlab) GroupProjects(id string) ([]*Project, *ResponseMeta, error)

func (*Gitlab) GroupVariable

func (g *Gitlab) GroupVariable(groupId, varKey string) (*Variable, *ResponseMeta, error)

func (*Gitlab) GroupVariables

func (g *Gitlab) GroupVariables(groupId string, o *PaginationOptions) ([]*Variable, *ResponseMeta, error)

func (*Gitlab) Groups

func (g *Gitlab) Groups(o *GroupsOptions) ([]*Group, *ResponseMeta, error)

func (*Gitlab) ListKeys

func (g *Gitlab) ListKeys(id string) ([]*PublicKey, *ResponseMeta, error)

func (*Gitlab) MergeRequests

func (g *Gitlab) MergeRequests(o *MergeRequestsOptions) ([]*MergeRequest, *ResponseMeta, error)

func (*Gitlab) Namespace

func (g *Gitlab) Namespace(id string) (*Namespace, *ResponseMeta, error)

func (*Gitlab) Namespaces

func (g *Gitlab) Namespaces(o *NamespacesOptions) ([]*Namespace, *ResponseMeta, error)

func (*Gitlab) Project

func (g *Gitlab) Project(id string, withStatistics bool) (*Project, *ResponseMeta, error)

func (*Gitlab) ProjectBadge

func (g *Gitlab) ProjectBadge(projectId, badgeId string) (*Badge, *ResponseMeta, error)

func (*Gitlab) ProjectBadges

func (g *Gitlab) ProjectBadges(projectId string, o *PaginationOptions) ([]*Badge, *ResponseMeta, error)

func (*Gitlab) ProjectBranch

func (g *Gitlab) ProjectBranch(projectId, branchName string) (*Branch, *ResponseMeta, error)

func (*Gitlab) ProjectBranches

func (g *Gitlab) ProjectBranches(projectId string, o *BranchesOptions) ([]*Branch, *ResponseMeta, error)

func (*Gitlab) ProjectBuildArtifacts

func (g *Gitlab) ProjectBuildArtifacts(id, buildId string) (io.ReadCloser, error)

func (*Gitlab) ProjectCommitBuilds

func (g *Gitlab) ProjectCommitBuilds(id, sha1 string) ([]*Build, *ResponseMeta, error)

func (*Gitlab) ProjectCommitStatuses

func (g *Gitlab) ProjectCommitStatuses(id, sha1 string) ([]*CommitStatus, *ResponseMeta, error)

func (*Gitlab) ProjectDeployKey

func (g *Gitlab) ProjectDeployKey(id, keyId string) (*PublicKey, *ResponseMeta, error)

Get single project deploy key.

GET /projects/:id/keys/:key_id

Parameters:

id    The ID of a project
keyId The ID of a key

func (*Gitlab) ProjectDeployKeys

func (g *Gitlab) ProjectDeployKeys(id string) ([]*PublicKey, *ResponseMeta, error)

Get list of project deploy keys.

GET /projects/:id/keys

Parameters:

id The ID of a project

func (*Gitlab) ProjectHook

func (g *Gitlab) ProjectHook(projectId, hookId string) (*Hook, *ResponseMeta, error)

func (*Gitlab) ProjectHooks

func (g *Gitlab) ProjectHooks(projectId string) ([]*Hook, *ResponseMeta, error)

func (*Gitlab) ProjectJob

func (g *Gitlab) ProjectJob(projectId string, jobId int) (*Job, *ResponseMeta, error)

func (*Gitlab) ProjectJobTrace

func (g *Gitlab) ProjectJobTrace(projectId string, jobId int) (string, *ResponseMeta, error)

func (*Gitlab) ProjectJobs

func (g *Gitlab) ProjectJobs(projectId string, o *JobsOptions) ([]*Job, *ResponseMeta, error)

func (*Gitlab) ProjectMembers

func (g *Gitlab) ProjectMembers(projectId string, o *MembersOptions) ([]*Member, *ResponseMeta, error)

func (*Gitlab) ProjectMergeRequest

func (g *Gitlab) ProjectMergeRequest(projectId string, mergeRequestId int) (*MergeRequest, *ResponseMeta, error)

func (*Gitlab) ProjectMergeRequestAccept

func (g *Gitlab) ProjectMergeRequestAccept(id, merge_request_id string, req *AcceptMergeRequestRequest) (*MergeRequest, error)

Merge changes submitted with MR.

PUT /projects/:id/merge_request/:merge_request_id/merge

Parameters:

id               The ID of a project
merge_request_id The ID of a merge request

func (*Gitlab) ProjectMergeRequestCancelMerge

func (g *Gitlab) ProjectMergeRequestCancelMerge(id, merge_request_id string) (*MergeRequest, *ResponseMeta, error)

Cancel Merge When Build Succeeds.

PUT /projects/:id/merge_request/:merge_request_id/cancel_merge_when_build_succeeds

Parameters:

id               The ID of a project
merge_request_id The ID of a merge request

func (*Gitlab) ProjectMergeRequestChanges

func (g *Gitlab) ProjectMergeRequestChanges(id, merge_request_id string) (*MergeRequestChanges, *ResponseMeta, error)

Get information about the merge request including its files and changes.

GET /projects/:id/merge_request/:merge_request_id/changes

Parameters:

id               The ID of a project
merge_request_id The ID of a merge request

func (*Gitlab) ProjectMergeRequestCommits

func (g *Gitlab) ProjectMergeRequestCommits(id, merge_request_id string) ([]*Commit, *ResponseMeta, error)

Get a list of merge request commits.

GET /projects/:id/merge_request/:merge_request_id/commits

Parameters:

id               The ID of a project
merge_request_id The ID of a merge request

func (*Gitlab) ProjectMergeRequests

func (g *Gitlab) ProjectMergeRequests(projectId string, o *MergeRequestsOptions) ([]*MergeRequest, *ResponseMeta, error)

func (*Gitlab) ProjectPipeline

func (g *Gitlab) ProjectPipeline(projectId, pipelineId string) (*PipelineWithDetails, *ResponseMeta, error)

func (*Gitlab) ProjectPipelineJobs

func (g *Gitlab) ProjectPipelineJobs(projectId string, pipelineId int, o *JobsOptions) ([]*Job, *ResponseMeta, error)

func (*Gitlab) ProjectPipelines

func (g *Gitlab) ProjectPipelines(projectId string, o *PipelinesOptions) ([]*Pipeline, *ResponseMeta, error)

func (*Gitlab) ProjectRunners

func (g *Gitlab) ProjectRunners(projectId string, page, per_page int) ([]*Runner, *ResponseMeta, error)

func (*Gitlab) ProjectVariable

func (g *Gitlab) ProjectVariable(projectId, varKey string) (*Variable, *ResponseMeta, error)

func (*Gitlab) ProjectVariables

func (g *Gitlab) ProjectVariables(projectId string, o *PaginationOptions) ([]*Variable, *ResponseMeta, error)

func (*Gitlab) Projects

func (g *Gitlab) Projects(o *ProjectsOptions) ([]*Project, *ResponseMeta, error)

func (*Gitlab) ProtectBranch

func (g *Gitlab) ProtectBranch(projectId, branchName string) (*ResponseMeta, error)

func (*Gitlab) ProtectedBranches

func (g *Gitlab) ProtectedBranches(projectId string, o *PaginationOptions) ([]*ProtectedBranch, *ResponseMeta, error)

func (*Gitlab) RemoveGroup

func (g *Gitlab) RemoveGroup(id string) (string, *ResponseMeta, error)

func (*Gitlab) RemoveGroupVariable

func (g *Gitlab) RemoveGroupVariable(groupId, varKey string) (*ResponseMeta, error)

func (*Gitlab) RemoveProject

func (g *Gitlab) RemoveProject(id string) (string, *ResponseMeta, error)

func (*Gitlab) RemoveProjectBadge

func (g *Gitlab) RemoveProjectBadge(projectId, badgeId string) (*ResponseMeta, error)

func (*Gitlab) RemoveProjectBranch

func (g *Gitlab) RemoveProjectBranch(projectId, branchName string) (*ResponseMeta, error)

func (*Gitlab) RemoveProjectDeployKey

func (g *Gitlab) RemoveProjectDeployKey(id, keyId string) (*ResponseMeta, error)

Remove deploy key from project

DELETE /projects/:id/keys/:key_id

Parameters:

id    The ID of a project
keyId The ID of a key

func (*Gitlab) RemoveProjectHook

func (g *Gitlab) RemoveProjectHook(projectId, hookId string) (*ResponseMeta, error)

func (*Gitlab) RemoveProjectMergedBranches

func (g *Gitlab) RemoveProjectMergedBranches(projectId string) (string, *ResponseMeta, error)

func (*Gitlab) RemoveProjectVariable

func (g *Gitlab) RemoveProjectVariable(projectId, varKey string) (*ResponseMeta, error)

func (*Gitlab) RemoveUser

func (g *Gitlab) RemoveUser(id string) (*ResponseMeta, error)

func (*Gitlab) RepoActivityFeed

func (g *Gitlab) RepoActivityFeed(feedPath string) ActivityFeed

func (*Gitlab) RepoCommits

func (g *Gitlab) RepoCommits(id string) ([]*Commit, *ResponseMeta, error)

Get a list of repository commits in a project.

GET /projects/:id/repository/commits

Parameters:

    id      The ID of a project
	refName The name of a repository branch or tag or if not given the default branch

Usage:

commits, err := gitlab.RepoCommits("your_projet_id")
if err != nil {
	fmt.Println(err.Error())
}
for _, commit := range commits {
	fmt.Printf("%+v\n", commit)
}

func (*Gitlab) RepoRawFile

func (g *Gitlab) RepoRawFile(id, sha, filepath string) ([]byte, *ResponseMeta, error)

Get Raw file content

func (*Gitlab) RepoTags

func (g *Gitlab) RepoTags(id string) ([]*Tag, *ResponseMeta, error)

Get a list of repository tags from a project, sorted by name in reverse alphabetical order.

GET /projects/:id/repository/tags

Parameters:

id The ID of a project

Usage:

tags, err := gitlab.RepoTags("your_projet_id")
if err != nil {
	fmt.Println(err.Error())
}
for _, tag := range tags {
	fmt.Printf("%+v\n", tag)
}

func (*Gitlab) RepoTree

func (g *Gitlab) RepoTree(id, path, refName string) ([]*TreeNode, *ResponseMeta, error)

Get a list of repository files and directories in a project.

GET /projects/:id/repository/tree

Parameters:

    id (required) The ID of a project
    path (optional) The path inside repository. Used to get contend of subdirectories
		ref_name (optional) The name of a repository branch or tag or if not given the default branch

Usage:

pass nil when not using optional parameters

func (*Gitlab) ResourceUrl

func (g *Gitlab) ResourceUrl(p string, params map[string]string) *url.URL

func (*Gitlab) RetryProjectJob

func (g *Gitlab) RetryProjectJob(projectId string, jobId int) (*Job, *ResponseMeta, error)

func (*Gitlab) Runner

func (g *Gitlab) Runner(id int) (*RunnerWithDetails, *ResponseMeta, error)

func (*Gitlab) Runners

func (g *Gitlab) Runners(o *RunnersOptions) ([]*Runner, *ResponseMeta, error)

func (*Gitlab) StarProject

func (g *Gitlab) StarProject(id string) (*Project, *ResponseMeta, error)

func (*Gitlab) UnprotectBranch

func (g *Gitlab) UnprotectBranch(projectId, branchName string) (*ResponseMeta, error)

func (*Gitlab) UnstarProject

func (g *Gitlab) UnstarProject(id string) (*Project, *ResponseMeta, error)

func (*Gitlab) UpdateGroup

func (g *Gitlab) UpdateGroup(id string, group *GroupUpdatePayload) (*GroupWithDetails, error)

func (*Gitlab) UpdateProject

func (g *Gitlab) UpdateProject(id string, project *Project) (*Project, *ResponseMeta, error)

func (*Gitlab) UpdateRunner

func (g *Gitlab) UpdateRunner(id int, runner *Runner) (*Runner, *ResponseMeta, error)

func (*Gitlab) User

func (g *Gitlab) User(id string) (*User, *ResponseMeta, error)

func (*Gitlab) UserKey

func (g *Gitlab) UserKey(id string) (*PublicKey, *ResponseMeta, error)

func (*Gitlab) UserKeys

func (g *Gitlab) UserKeys() ([]*PublicKey, *ResponseMeta, error)

func (*Gitlab) Users

func (g *Gitlab) Users(o *UsersOptions) ([]*User, *ResponseMeta, error)

type Group

type Group struct {
	Id                        int        `json:"id,omitempty" yaml:"id,omitempty"`
	Name                      string     `json:"name" yaml:"name"`
	Path                      string     `json:"path" yaml:"path"`
	Description               string     `json:"description" yaml:"description"`
	Visibility                Visibility `json:"visibility" yaml:"visibility"`
	LfsEnabled                bool       `json:"lfs_enabled" yaml:"lfs_enabled"`
	RequestAccessEnabled      bool       `json:"request_access_enabled" yaml:"request_access_enabled"`
	ParentId                  int        `json:"parent_id" yaml:"parent_id"`
	SharedRunnersMinutesLimit int        `json:"shared_runners_minutes_limit" yaml:"shared_runners_minutes_limit"`
	AvatarUrl                 string     `json:"avatar_url" yaml:"avatar_url"`
	WebURL                    string     `json:"web_url" yaml:"web_url"`
	FullName                  string     `json:"full_name" yaml:"full_name"`
	FullPath                  string     `json:"full_path" yaml:"full_path"`
}

type GroupAddPayload

type GroupAddPayload struct {
	Name                      string     `json:"name"`
	Path                      string     `json:"path"`
	Description               string     `json:"description,omitempty"`
	Visibility                Visibility `json:"visibility,omitempty"`
	LfsEnabled                bool       `json:"lfs_enabled,omitempty"`
	RequestAccessEnabled      bool       `json:"request_access_enabled,omitempty"`
	ParentId                  int        `json:"parent_id,omitempty"`
	SharedRunnersMinutesLimit int        `json:"shared_runners_minutes_limit,omitempty"`
}

type GroupUpdatePayload

type GroupUpdatePayload struct {
	Id                        int        `json:"id,omitempty"`
	Name                      string     `json:"name"`
	Path                      string     `json:"path"`
	Description               string     `json:"description,omitempty"`
	MembershipLock            bool       `json:"membership_lock,omitempty"`
	ShareWithGroupLock        bool       `json:"share_with_group_lock,omitempty"`
	Visibility                Visibility `json:"visibility,omitempty"`
	LfsEnabled                bool       `json:"lfs_enabled,omitempty"`
	RequestAccessEnabled      bool       `json:"request_access_enabled,omitempty"`
	SharedRunnersMinutesLimit int        `json:"shared_runners_minutes_limit,omitempty"`
}

type GroupWithDetails

type GroupWithDetails struct {
	Group          `yaml:",inline"`
	Projects       []*Project `json:"projects" yaml:"projects"`
	SharedProjects []*Project `json:"shared_projects" yaml:"shared_projects"`
}

type GroupsOptions

type GroupsOptions struct {
	PaginationOptions
	SkipGroups           []string // Skip the group IDs passed
	AllAvailable         bool     //Show all the groups you have access to (defaults to false for authenticated users, true for admin)
	Search               string   // Return the list of authorized groups matching the search criteria
	Statistics           bool     // Include group statistics (admins only)
	WithCustomAttributes bool     // Include custom attributes in response (admins only)
	Owned                bool     // Limit to groups owned by the current user

}

type Hook

type Hook struct {
	HookAddPayload
	Id        int    `json:"id,omitempty"`
	ProjectId int    `json:"project_id,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
}

type HookAddPayload

type HookAddPayload struct {
	Url                      string `json:"url"`
	PushEvents               bool   `json:"push_events"`
	IssuesEvents             bool   `json:"issues_events"`
	ConfidentialIssuesEvents bool   `json:"confidential_issues_events"`
	MergeRequestsEvents      bool   `json:"merge_requests_events"`
	TagPushEvents            bool   `json:"tag_push_events"`
	NoteEvents               bool   `json:"note_events"`
	JobEvents                bool   `json:"job_events"`
	PipelineEvents           bool   `json:"pipeline_events"`
	WikiPageEvents           bool   `json:"wiki_page_events"`
	EnableSslVerification    bool   `json:"enable_ssl_verification"`
	Token                    string `json:"token"`
}

type HookObjAttr

type HookObjAttr struct {
	Id              int       `json:"id,omitempty"`
	Ref             string    `json:"ref,omitempty"`
	Tag             bool      `json:"tag,omitempty"`
	Sha             string    `json:"sha,omitempty"`
	BeforeSha       string    `json:"before_sha,omitempty"`
	Title           string    `json:"title,omitempty"`
	AssigneeId      int       `json:"assignee_id,omitempty"`
	AuthorId        int       `json:"author_id,omitempty"`
	ProjectId       int       `json:"project_id,omitempty"`
	Status          string    `json:"status,omitempty"`
	Stages          []string  `json:"stages,omitempty"`
	CreatedAt       time.Time `json:"created_at,omitempty"`
	UpdatedAt       time.Time `json:"updated_at,omitempty"`
	FinishedAt      time.Time `json:"finished_at,omitempty"`
	Duration        int       `json:"duration,omitempty"`
	Position        int       `json:"position,omitempty"`
	BranchName      string    `json:"branch_name,omitempty"`
	Description     string    `json:"description,omitempty"`
	MilestoneId     int       `json:"milestone_id,omitempty"`
	State           string    `json:"state,omitempty"`
	IId             int       `json:"iid,omitempty"`
	TargetBranch    string    `json:"target_branch,omitempty"`
	SourceBranch    string    `json:"source_branch,omitempty"`
	SourceProjectId int       `json:"source_project_id,omitempty"`
	StCommits       string    `json:"st_commits,omitempty"`
	StDiffs         string    `json:"st_diffs,omitempty"`
	MergeStatus     string    `json:"merge_status,omitempty"`
	TargetProjectId int       `json:"target_project_id,omitempty"`
}

type HookPayload

type HookPayload struct {
	Before            string       `json:"before,omitempty"`
	After             string       `json:"after,omitempty"`
	Ref               string       `json:"ref,omitempty"`
	UserId            int          `json:"user_id,omitempty"`
	UserName          string       `json:"user_name,omitempty"`
	ProjectId         int          `json:"project_id,omitempty"`
	Project           *hProject    `json:"project,omitempty"`
	Repository        *hRepository `json:"repository,omitempty"`
	Commits           []hCommit    `json:"commits,omitempty"`
	Commit            *hCommit     `json:"commit,omitempty"`
	TotalCommitsCount int          `json:"total_commits_count,omitempty"`
	ObjectKind        string       `json:"object_kind,omitempty"`
	ObjectAttributes  *HookObjAttr `json:"object_attributes,omitempty"`
	Builds            []*Build     `json:"builds,omitempty"`
}

func ParseHook

func ParseHook(payload []byte) (*HookPayload, error)

ParseHook parses hook payload from GitLab

func (*HookPayload) Branch

func (h *HookPayload) Branch() string

Branch returns current branch for pipeline and push event hook payload This function returns empty string for any other events

func (*HookPayload) Head

func (h *HookPayload) Head() hCommit

Head returns the latest changeset for push event hook payload

type Issue

type Issue struct {
	Id          int        `json:"id"`
	IId         int        `json:"iid"`
	ProjectId   int        `json:"project_id,omitempty"`
	Title       string     `json:"title,omitempty"`
	Description string     `json:"description,omitempty"`
	Labels      []string   `json:"labels,omitempty"`
	Milestone   *Milestone `json:"milestone,omitempty"`
	Assignee    *User      `json:"assignee,omitempty"`
	Author      *User      `json:"author,omitempty"`
	State       string     `json:"state,omitempty"`
	CreatedAt   string     `json:"created_at,omitempty"`
	UpdatedAt   string     `json:"updated_at,omitempty"`
}

type IssueRequest

type IssueRequest struct {
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	AssigneeId  int    `json:"assignee_id,omitempty"`
	MilestoneId int    `json:"milestone_id,omitempty"`
	Labels      string `json:"labels,omitempty"`
}

type Job

type Job struct {
	Id                int     `json:"id,omitempty" yaml:"id,omitempty"`
	Name              string  `json:"name,omitempty" yaml:"name,omitempty"`
	Status            string  `json:"status,omitempty" yaml:"status,omitempty"`
	Stage             string  `json:"stage,omitempty" yaml:"stage,omitempty"`
	Ref               string  `json:"ref,omitempty" yaml:"ref,omitempty"`
	Tag               bool    `json:"tag,omitempty" yaml:"tag,omitempty"`
	Coverage          float64 `json:"coverage,omitempty" yaml:"coverage,omitempty"`
	CreatedAt         string  `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	StartedAt         string  `json:"started_at,omitempty" yaml:"started_at,omitempty"`
	FinishedAt        string  `json:"finished_at,omitempty" yaml:"finished_at,omitempty"`
	Duration          float64 `json:"duration,omitempty" yaml:"duration,omitempty"`
	ArtifactsExpireAt string  `json:"artifacts_expire_at,omitempty" yaml:"artifacts_expire_at,omitempty"`
	Pipeline          struct {
		Id     int    `json:"id,omitempty" yaml:"id,omitempty"`
		Status string `json:"status,omitempty" yaml:"status,omitempty"`
		Ref    string `json:"ref,omitempty" yaml:"ref,omitempty"`
		Sha    string `json:"sha,omitempty" yaml:"sha,omitempty"`
	} `json:"pipeline" yaml:"pipeline"`
	User struct {
		Id           int    `json:"id,omitempty" yaml:"id,omitempty"`
		Name         string `json:"name,omitempty" yaml:"name,omitempty"`
		Username     string `json:"username,omitempty" yaml:"username,omitempty"`
		State        string `json:"state,omitempty" yaml:"state,omitempty"`
		AvatarUrl    string `json:"avatar_url,omitempty" yaml:"avatar_url,omitempty"`
		WebUrl       string `json:"web_url,omitempty" yaml:"web_url,omitempty"`
		CreatedAt    string `json:"created_at,omitempty" yaml:"created_at,omitempty"`
		Bio          string `json:"bio,omitempty" yaml:"bio,omitempty"`
		Location     string `json:"location,omitempty" yaml:"location,omitempty"`
		Skype        string `json:"skype,omitempty" yaml:"skype,omitempty"`
		Linkedin     string `json:"linkedin,omitempty" yaml:"linkedin,omitempty"`
		Twitter      string `json:"twitter,omitempty" yaml:"twitter,omitempty"`
		WebsiteUrl   string `json:"website_url,omitempty" yaml:"website_url,omitempty"`
		Organization string `json:"organization,omitempty" yaml:"organization,omitempty"`
	} `json:"user" yaml:"user"`
	Commit struct {
		Id             string   `json:"id,omitempty" yaml:"id,omitempty"`
		ShortId        string   `json:"short_id,omitempty" yaml:"short_id,omitempty"`
		Title          string   `json:"title,omitempty" yaml:"title,omitempty"`
		Message        string   `json:"message,omitempty" yaml:"message,omitempty"`
		AuthorName     string   `json:"author_name,omitempty" yaml:"author_name,omitempty"`
		AuthorEmail    string   `json:"author_email,omitempty" yaml:"author_email,omitempty"`
		CommitterName  string   `json:"committer_name,omitempty" yaml:"committer_name,omitempty"`
		CommitterEmail string   `json:"committer_email,omitempty" yaml:"committer_email,omitempty"`
		CreatedAt      string   `json:"created_at,omitempty" yaml:"created_at,omitempty"`
		AuthoredDate   string   `json:"authored_date,omitempty" yaml:"authored_date,omitempty"`
		CommittedDate  string   `json:"committed_date,omitempty" yaml:"committed_date,omitempty"`
		ParentIds      []string `json:"parent_ids,omitempty" yaml:"parent_ids,omitempty"`
	} `json:"commit" yaml:"commit"`
	Runner struct {
		Id          int    `json:"id,omitempty" yaml:"id,omitempty"`
		Name        string `json:"name,omitempty" yaml:"name,omitempty"`
		Description string `json:"description,omitempty" yaml:"description,omitempty"`
		IpAddress   string `json:"ip_address,omitempty" yaml:"ip_address,omitempty"`
		Active      bool   `json:"active,omitempty" yaml:"active,omitempty"`
		IsShared    bool   `json:"is_shared,omitempty" yaml:"is_shared,omitempty"`
		Online      bool   `json:"online,omitempty" yaml:"online,omitempty"`
		Status      string `json:"status,omitempty" yaml:"status,omitempty"`
	} `json:"runner" yaml:"runner"`
}

type JobsOptions

type JobsOptions struct {
	PaginationOptions
	// The scope of jobs to show, one or array of:
	// created, pending, running, failed, success, canceled, skipped, manual;
	// showing all jobs if none provided
	Scope []string
}
type Link struct {
	Rel  string `xml:"rel,attr,omitempty" json:"rel"`
	Href string `xml:"href,attr" json:"href"`
}

type Member

type Member struct {
	Id          int    `json:"id"`
	Username    string `json:"username"`
	Name        string `json:"name"`
	State       string `json:"state"`
	AvatarUrl   string `json:"avatar_url"`
	WebUrl      string `json:"web_url"`
	CreatedAt   string `json:"created_at"`
	ExpiresAt   string `json:"expires_at"`
	AccessLevel int    `json:"access_level"`
}

type MembersOptions

type MembersOptions struct {
	PaginationOptions
	Query string
}

type MergeRequest

type MergeRequest struct {
	Id                        int               `json:"id,omitempty" yaml:"id,omitempty"`
	Iid                       int               `json:"iid,omitempty" yaml:"iid,omitempty"`
	ProjectId                 int               `json:"project_id,omitempty" yaml:"project_id,omitempty"`
	WebUrl                    string            `json:"web_url,omitempty" yaml:"web_url,omitempty"`
	Title                     string            `json:"title,omitempty" yaml:"title,omitempty"`
	Description               string            `json:"description,omitempty" yaml:"description,omitempty"`
	State                     string            `json:"state,omitempty" yaml:"state,omitempty"`
	CreatedAt                 string            `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	UpdatedAt                 string            `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	SourceBranch              string            `json:"source_branch,omitempty" yaml:"source_branch,omitempty"`
	TargetBranch              string            `json:"target_branch,omitempty" yaml:"target_branch,omitempty"`
	Upvotes                   int               `json:"upvotes,omitempty" yaml:"upvotes,omitempty"`
	Downvotes                 int               `json:"downvotes,omitempty" yaml:"downvotes,omitempty"`
	SourceProjectID           int               `json:"source_project_id,omitempty" yaml:"source_project_id,omitempty"`
	TargetProjectID           int               `json:"target_project_id,omitempty" yaml:"target_project_id,omitempty"`
	Sha                       string            `json:"sha,omitempty" yaml:"sha,omitempty"`
	MergeCommitSha            string            `json:"merge_commit_sha,omitempty" yaml:"merge_commit_sha,omitempty"`
	WorkInProgress            bool              `json:"work_in_progress,omitempty" yaml:"work_in_progress,omitempty"`
	MergeStatus               string            `json:"merge_status,omitempty" yaml:"merge_status,omitempty"`
	Squash                    bool              `json:"squash,omitempty" yaml:"squash,omitempty"`
	MergeWhenPipelineSucceeds bool              `json:"merge_when_pipeline_succeeds,omitempty" yaml:"merge_when_pipeline_succeeds,omitempty"`
	ShouldRemoveSourceBranch  bool              `json:"should_remove_source_branch,omitempty" yaml:"should_remove_source_branch,omitempty"`
	ForceRemoveSourceBranch   bool              `json:"force_remove_source_branch,omitempty" yaml:"force_remove_source_branch,omitempty"`
	DiscussionLocked          bool              `json:"discussion_locked,omitempty" yaml:"discussion_locked,omitempty"`
	UserNotesCount            int               `json:"user_notes_count,omitempty" yaml:"user_notes_count,omitempty"`
	Pipeline                  *Pipeline         `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
	Author                    *MergeRequestUser `json:"author,omitempty" yaml:"author,omitempty"`
	Assignee                  *MergeRequestUser `json:"assignee,omitempty" yaml:"assignee,omitempty"`
	Labels                    []string          `json:"labels,omitempty" yaml:"labels,omitempty"`
	TimeStats                 *TimeStats        `json:"time_stats,omitempty" yaml:"time_stats,omitempty"`
	Milestone                 *Milestone        `json:"milestone,omitempty" yaml:"milestone,omitempty"`
}

type MergeRequestChanges

type MergeRequestChanges struct {
	*MergeRequest
	CreatedAt       string       `json:"created_at,omitempty"`
	UpdatedAt       string       `json:"updated_at,omitempty"`
	SourceProjectId int          `json:"source_project_id,omitempty"`
	TargetProjectId int          `json:"target_project_id,omitempty"`
	Labels          []string     `json:"labels,omitempty"`
	Milestone       Milestone    `json:"milestone,omitempty"`
	Changes         []ChangeItem `json:"changes,omitempty"`
}

type MergeRequestScope

type MergeRequestScope string
const (
	MergeRequestScopeCreatedByMe        MergeRequestScope = "created_by_me"
	LegacyMergeRequestScopeCreatedByMe  MergeRequestScope = "created-by-me"
	MergeRequestScopeAssignedToMe       MergeRequestScope = "assigned_to_me"
	LegacyMergeRequestScopeAssignedToMe MergeRequestScope = "assigned-to-me"
	MergeRequestScopeAll                MergeRequestScope = "all"
)

For versions before 11.0, use the now deprecated created-by-me or assigned-to-me scopes

type MergeRequestUser

type MergeRequestUser struct {
	Id        int    `json:"id,omitempty" yaml:"id,omitempty"`
	Username  string `json:"username,omitempty" yaml:"username,omitempty"`
	Name      string `json:"name,omitempty" yaml:"name,omitempty"`
	State     string `json:"state,omitempty" yaml:"state,omitempty"`
	AvatarUrl string `json:"avatar_url,omitempty" yaml:"avatar_url,omitempty"`
	WebUrl    string `json:"web_url,omitempty" yaml:"web_url,omitempty"`
}

type MergeRequestsOptions

type MergeRequestsOptions struct {
	PaginationOptions

	// Return all merge requests or just those that are
	// opened, closed, locked, or merged
	State string

	// Return merge requests ordered by created_at or
	// updated_at fields. Default is created_at
	OrderBY string

	// sort	string	no	Return requests sorted in asc or desc order
	// Default is desc
	Sort string

	// Return merge requests for a specific milestone
	Milestone string

	// If simple, returns the iid, URL, title, description,
	// and basic state of merge request
	View string

	// Return merge requests matching a comma separated
	// list of labels
	Labels []string

	// Return merge requests created on or after the given time
	CreatedAfter *time.Time

	// Return merge requests created on or before the given time
	CreatedBefore *time.Time

	// Return merge requests updated on or after the given time
	UpdatedAfter *time.Time

	// Return merge requests updated on or before the given time
	UpdatedBefore *time.Time

	// Return merge requests with the given source branch
	SourceBranch string

	// Return merge requests with the given target branch
	TargetBranch string

	// Search merge requests against their title and description
	Search string

	// Returns merge requests created by the given user id
	AuthorId int

	// Returns merge requests assigned to the given user id
	AssigneeId int

	// Return merge requests reacted by the authenticated user by the given emoji
	MyReactionEmoji string

	// Return merge requests for the given scope: created_by_me, assigned_to_me or all,
	// For versions before 11.0, use the now deprecated created-by-me or assigned-to-me scopes instead.
	Scope MergeRequestScope
	// contains filtered or unexported fields
}

type Milestone

type Milestone struct {
	Id          int    `json:"id,omitempty" yaml:"id,omitempty"`
	Iid         int    `json:"iid,omitempty" yaml:"iid,omitempty"`
	ProjectID   int    `json:"project_id,omitempty" yaml:"project_id,omitempty"`
	State       string `json:"state,omitempty" yaml:"state,omitempty"`
	Title       string `json:"title,omitempty" yaml:"title,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	StartDate   string `json:"start_date,omitempty" yaml:"start_date,omitempty"`
	DueDate     string `json:"due_date,omitempty" yaml:"due_date,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	CreatedAt   string `json:"created_at,omitempty" yaml:"created_at,omitempty"`
}

type MinimalProject

type MinimalProject struct {
	Id                int    `json:"id"`
	Name              string `json:"name"`
	NameWithNamespace string `json:"name_with_namespace"`
	Path              string `json:"path"`
	PathWithNamespace string `json:"path_with_namespace"`
}

type Namespace

type Namespace struct {
	Id                          int    `json:"id,omitempty"`
	Name                        string `json:"name,omitempty,omitempty"`
	Path                        string `json:"path,omitempty,omitempty"`
	Kind                        string `json:"kind,omitempty,omitempty"`
	FullPath                    string `json:"full_path,omitempty,omitempty"`
	ParentId                    int    `json:"parent_id,omitempty"`
	MembersCountWithDescendants int    `json:"members_count_with_descendants,omitempty"`
	Plan                        string `json:"plan,omitempty"`
	Description                 string `json:"description,omitempty"`
	OwnerId                     int    `json:"owner_id,omitempty"`
	CreatedAt                   string `json:"createdAt,omitempty"`
	UpdatedAt                   string `json:"updatedAt,omitempty"`
}

type NamespacesOptions

type NamespacesOptions struct {
	PaginationOptions
	Search string // Returns a list of namespaces the user is authorized to see based on the search criteria
}

type PaginationOptions

type PaginationOptions struct {
	Page    int
	PerPage int
}

type Person

type Person struct {
	Name  string `xml:"name" json:"name"`
	Email string `xml:"email" json:"email"`
}

type Pipeline

type Pipeline struct {
	Id     int    `json:"id"`
	Status string `json:"status"`
	Ref    string `json:"ref"`
	Sha    string `json:"sha"`
}

type PipelineWithDetails

type PipelineWithDetails struct {
	Pipeline
	BeforeSha   string `json:"before_sha"`
	Tag         bool   `json:"tag"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	StartedAt   string `json:"started_at"`
	FinishedAt  string `json:"finished_at"`
	CommittedAt string `json:"committed_at"`
	Duration    int    `json:"duration"`
	Coverage    string `json:"coverage"`
	YamlErrors  string `json:"yaml_errors"`
	User        struct {
		Id        int    `json:"id"`
		Username  string `json:"username"`
		Name      string `json:"name"`
		State     string `json:"state"`
		AvatarUrl string `json:"avatar_url"`
		WebUrl    string `json:"web_url"`
	}
}

type PipelinesOptions

type PipelinesOptions struct {
	PaginationOptions
	Scope      string // The scope of pipelines, one of: running, pending, finished, branches, tags
	Status     string // The status of pipelines, one of: running, pending, success, failed, canceled, skipped
	Ref        string // The ref of pipelines
	Sha        string // The sha or pipelines
	YamlErrors bool   // Returns pipelines with invalid configurations
	Name       string // The name of the user who triggered pipelines
	Username   string // The username of the user who triggered pipelines
	OrderBy    string // Order pipelines by id, status, ref, or user_id (default: id)
	Sort       string // Sort pipelines in asc or desc order (default: desc)
}

type Project

type Project struct {
	MinimalProject
	Description                               string                 `json:"description"`
	DefaultBranch                             string                 `json:"default_branch"`
	Owner                                     *Member                `json:"owner"`
	Public                                    bool                   `json:"public"`
	Visibility                                Visibility             `json:"visibility"`
	IssuesEnabled                             bool                   `json:"issues_enabled"`
	OpenIssuesCount                           int                    `json:"open_issues_count"`
	MergeRequestsEnabled                      bool                   `json:"merge_requests_enabled"`
	WallEnabled                               bool                   `json:"wall_enabled"`
	WikiEnabled                               bool                   `json:"wiki_enabled"`
	CreatedAtRaw                              string                 `json:"created_at,omitempty"`
	Namespace                                 *Namespace             `json:"namespace,omitempty"`
	NamespaceId                               int                    `json:"namespace_id"`
	SshRepoUrl                                string                 `json:"ssh_url_to_repo"`
	HttpRepoUrl                               string                 `json:"http_url_to_repo"`
	WebUrl                                    string                 `json:"web_url"`
	ReadmeUrl                                 string                 `json:"readme_url"`
	SharedRunnersEnabled                      bool                   `json:"shared_runners_enabled"`
	Archived                                  bool                   `json:"archived"`
	OnlyAllowMergeIfPipelineSucceeds          bool                   `json:"only_allow_merge_if_pipeline_succeeds"`
	OnlyAllowMergeIfAllDiscussionsAreResolved bool                   `json:"only_allow_merge_if_all_discussions_are_resolved"`
	MergeMethod                               string                 `json:"merge_method"`
	TagList                                   []string               `json:"tag_list"`
	SharedWithGroups                          []*ProjectGroupSharing `json:"shared_with_groups"`
	ForksCount                                int                    `json:"forks_count"`
	StarCount                                 int                    `json:"star_count"`
	Statistics                                *ProjectStatistics     `json:"statistics"`
}

type ProjectAddPayload

type ProjectAddPayload struct {
	Name string `json:"name"` // The name of the new project. Equals path if not provided
	Path string `json:"path"` // Repository name for new project. Generated based on name if not provided (generated lowercased with dashes)
}

type ProjectGroupSharing

type ProjectGroupSharing struct {
	GroupId          int    `json:"group_id"`
	GroupName        string `json:"group_name"`
	GroupAccessLevel int    `json:"group_access_level"`
}

type ProjectStatistics

type ProjectStatistics struct {
	CommitCount      int `json:"commit_count"`
	StorageSize      int `json:"storage_size"`
	RepositorySize   int `json:"repository_size"`
	LfsObjectsSize   int `json:"lfs_objects_size"`
	JobArtifactsSize int `json:"job_artifacts_size"`
}

type ProjectsOptions

type ProjectsOptions struct {
	PaginationOptions
	Archived                 bool          // Limit by archived status
	Visibility               Visibility    // Limit by visibility public, internal, or private
	OrderBy                  ProjectsOrder // Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields. Default is created_at
	Sort                     SortDirection // Return projects sorted in asc or desc order. Default is desc
	Search                   string        // Return list of projects matching the search criteria
	Simple                   bool          // Return only the ID, URL, name, and path of each project
	Owned                    bool          // Limit by projects owned by the current user
	Membership               bool          // Limit by projects that the current user is a member of
	Starred                  bool          // Limit by projects starred by the current user
	Statistics               bool          // Include project statistics
	WithCustomAttributes     bool          // Include custom attributes in response (admins only)
	WithIssuesEnabled        bool          // Limit by enabled issues feature
	WithMergeRequestsEnabled bool          // Limit by enabled merge requests feature
}

type ProjectsOrder

type ProjectsOrder string
const (
	ProjectsOrderId   ProjectsOrder = "id"
	ProjectsOrderName ProjectsOrder = "name"
	ProjectsOrderPath ProjectsOrder = "path"
)

type ProtectedBranch

type ProtectedBranch struct {
	Name              string             `json:"name,omitempty"`
	PushAccessLevels  []*AccessLevelInfo `json:"push_access_levels,omitempty"`
	MergeAccessLevels []*AccessLevelInfo `json:"merge_access_levels,omitempty"`
}

type PublicKey

type PublicKey struct {
	Id           int    `json:"id,omitempty"`
	Title        string `json:"title,omitempty"`
	Key          string `json:"key,omitempty"`
	CreatedAtRaw string `json:"created_at,omitempty"`
}

type ResponseMeta

type ResponseMeta struct {
	Method     string
	Url        string
	StatusCode int
	RequestId  string
	Page       int
	PerPage    int
	PrevPage   int
	NextPage   int
	TotalPages int
	Total      int
	Runtime    float64
}

type ResponseWithMessage

type ResponseWithMessage struct {
	Message string `json:"message"`
}

type Runner

type Runner struct {
	Id          int    `json:"id,omitempty" yaml:"id,omitempty"`
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Active      bool   `json:"active,omitempty" yaml:"active,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	IpAddress   string `json:"ip_address,omitempty" yaml:"ip_address,omitempty"`
	IsShared    bool   `json:"is_shared,omitempty" yaml:"is_shared,omitempty"`
	Online      bool   `json:"online,omitempty" yaml:"online,omitempty"`
	Status      string `json:"status,omitempty" yaml:"status,omitempty"`
}

type RunnerScope

type RunnerScope string
const (
	RunnerScopeSpecific RunnerScope = "specific"
	RunnerScopeShared   RunnerScope = "shared"
	RunnerScopeActive   RunnerScope = "active"
	RunnerScopePaused   RunnerScope = "paused"
	RunnerScopeOnline   RunnerScope = "online"
)

type RunnerWithDetails

type RunnerWithDetails struct {
	Runner         `yaml:",inline"`
	Architecture   string     `json:"architecture,omitempty" yaml:"architecture,omitempty"`
	Platform       string     `json:"platform,omitempty" yaml:"platform,omitempty"`
	Token          string     `json:"token,omitempty" yaml:"token,omitempty"`
	Revision       string     `json:"revision,omitempty" yaml:"revision,omitempty"`
	ContactedAt    string     `json:"contacted_at,omitempty" yaml:"contacted_at,omitempty"`
	Version        string     `json:"version,omitempty" yaml:"version,omitempty"`
	Projects       []*Project `json:"projects,omitempty" yaml:"projects,omitempty"`
	TagList        []string   `json:"tag_list,omitempty" yaml:"tag_list,omitempty"`
	AccessLevel    string     `json:"access_level,omitempty" yaml:"access_level,omitempty"`
	MaximumTimeout int        `json:"maximum_timeout,omitempty" yaml:"maximum_timeout,omitempty"`
}

type RunnersOptions

type RunnersOptions struct {
	PaginationOptions
	All   bool        // Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges
	Scope RunnerScope // The scope of runners to show, one of: specific, shared, active, paused, online; showing all runners if none provided
}

type SortDirection

type SortDirection string
const (
	SortDirectionAsc  SortDirection = "asc"
	SortDirectionDesc SortDirection = "desc"
)

type Tag

type Tag struct {
	Name      string        `json:"name,omitempty"`
	Protected bool          `json:"protected,omitempty"`
	Commit    *BranchCommit `json:"commit,omitempty"`
}

type TimeStats

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

type TreeNode

type TreeNode struct {
	Name string
	Type string
	Mode string
	Id   string
}

type User

type User struct {
	Id               int             `json:"id,omitempty"`
	Username         string          `json:"username,omitempty"`
	Email            string          `json:"email,omitempty"`
	Name             string          `json:"name,omitempty"`
	State            string          `json:"state,omitempty"`
	AvatarUrl        string          `json:"avatar_url,omitempty"`
	WebUrl           string          `json:"web_url"`
	CreatedAt        string          `json:"created_at,omitempty"`
	IsAdmin          bool            `json:"is_admin,omitempty"`
	Bio              string          `json:"bio,omitempty"`
	Location         string          `json:"location,omitempty"`
	Skype            string          `json:"skype,omitempty"`
	LinkedIn         string          `json:"linkedin,omitempty"`
	Twitter          string          `json:"twitter,omitempty"`
	WebsiteUrl       string          `json:"website_url"`
	Organization     string          `json:"organization"`
	LastSignInAt     string          `json:"last_sign_in_at,omitempty"`
	ConfirmedAt      string          `json:"confirmed_at,omitempty"`
	ThemeId          int             `json:"theme_id,omitempty"`
	LastActivityOn   string          `json:"last_activity_on,omitempty"`
	ColorSchemeId    int             `json:"color_scheme_id,omitempty"`
	ProjectsLimit    int             `json:"projects_limit,omitempty"`
	CurrentSignInAt  string          `json:"current_sign_in_at,omitempty"`
	Identities       []*UserIdentity `json:"identities,omitempty"`
	CanCreateGroup   bool            `json:"can_create_group,omitempty"`
	CanCreateProject bool            `json:"can_create_project,omitempty"`
	TwoFactorEnabled bool            `json:"two_factor_enabled,omitempty"`
	External         bool            `json:"external,omitempty"`
}

type UserIdentity

type UserIdentity struct {
	Provider  string `json:"provider,omitempty"`
	ExternUid string `json:"extern_uid,omitempty"`
}

type UsersOptions

type UsersOptions struct {
	PaginationOptions
	Search   string // Search users by email or username
	Username string // Search users by username
	Active   bool   // Limit to active users
	Blocked  bool   // Limit to blocked users
}

type Variable

type Variable struct {
	Key              string `json:"key"`
	Value            string `json:"value"`
	Protected        bool   `json:"protected"`
	EnvironmentScope string `json:"environment_scope,omitempty"`
}

type Visibility

type Visibility string
const (
	// VisibilityPrivate indicates project access must be granted explicitly for each user.
	VisibilityPrivate Visibility = "private"

	// VisibilityInternal indicates the project can be cloned by any logged in user.
	VisibilityInternal Visibility = "internal"

	// VisibilityPublic indicates the project can be cloned without any authentication.
	VisibilityPublic Visibility = "public"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL