gitlab

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gitlab

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

Gitlab def

func New

func New(url string, token string) (g *Gitlab)

New new gitlab structure

func (*Gitlab) AcceptMR

func (g *Gitlab) AcceptMR(projID int, mrIID int, msg string) (state string, err error)

AcceptMR accept Merge request

func (*Gitlab) AddProjectHook

func (g *Gitlab) AddProjectHook(projID int, hook *model.WebHook) (err error)

AddProjectHook add project hook for the project

func (*Gitlab) AuditProjectHooks

func (g *Gitlab) AuditProjectHooks(projID int, hooks []*model.WebHook) (err error)

AuditProjectHooks check and add or edit the project webhooks

func (*Gitlab) AuditProjects

func (g *Gitlab) AuditProjects(repos []*model.Repo, hooks []*model.WebHook) (err error)

AuditProjects audit all the given projects

func (*Gitlab) AwardEmojiUsernames

func (g *Gitlab) AwardEmojiUsernames(projID int, mrIID int) (usernames []string, err error)

AwardEmojiUsernames get the username who gave the emoji

func (*Gitlab) CloseMR

func (g *Gitlab) CloseMR(projID int, mrIID int) (err error)

CloseMR close merge request

func (*Gitlab) CommitDiff

func (g *Gitlab) CommitDiff(projID int, sha string) (files []string, err error)

CommitDiff ...

func (*Gitlab) CompareDiff

func (g *Gitlab) CompareDiff(projID int, from string, to string) (files []string, err error)

CompareDiff ...

func (*Gitlab) CreateMRNote

func (g *Gitlab) CreateMRNote(projID int, mrIID int, content string) (noteID int, err error)

CreateMRNote create note to merge request

func (*Gitlab) CreateTrigger

func (g *Gitlab) CreateTrigger(projectID int) (trigger *gitlab.PipelineTrigger, err error)

CreateTrigger create the trigger to trigger pipeline

func (*Gitlab) DeleteMRNote

func (g *Gitlab) DeleteMRNote(projID int, mrIID int, noteID int) (err error)

DeleteMRNote delete the specified note for merge request

func (*Gitlab) DeletePojectHook

func (g *Gitlab) DeletePojectHook(projID int, hookID int) (err error)

DeletePojectHook delete the specified hook for the project

func (*Gitlab) EditProjectHook

func (g *Gitlab) EditProjectHook(projID int, hookID int, hook *model.WebHook) (err error)

EditProjectHook edit the specified webhook for the project

func (*Gitlab) HostToken

func (g *Gitlab) HostToken() (host string, token string, err error)

HostToken ...

func (*Gitlab) LastGreenCommit

func (g *Gitlab) LastGreenCommit(ciProjectID string, ciCommitRefName string) (commit string, err error)

LastGreenCommit get last green pipeline commit

func (*Gitlab) LastPipeLineState

func (g *Gitlab) LastPipeLineState(projID int, ciCommitRefName string) (state bool, err error)

LastPipeLineState query Last PipeLineState

func (*Gitlab) ListProjectHook

func (g *Gitlab) ListProjectHook(projID int) (hooks []*gitlab.ProjectHook, err error)

ListProjectHook list all the webhook for the project

func (*Gitlab) MRChanges

func (g *Gitlab) MRChanges(projID, mrIID int) (changeFiles []string, deleteFiles []string, err error)

MRChanges ...

func (*Gitlab) MRPipelineStatus

func (g *Gitlab) MRPipelineStatus(projID int, mrIID int) (id int, status string, err error)

MRPipelineStatus query PipelineState for mr

func (*Gitlab) MergeLabels

func (g *Gitlab) MergeLabels(projID int, mrIID int) (labels []string, err error)

MergeLabels get Merge request labels

func (*Gitlab) MergeStatus

func (g *Gitlab) MergeStatus(projID int, mrIID int) (wip bool, state string, status string, err error)

MergeStatus query MergeStatus

func (*Gitlab) PlusUsernames

func (g *Gitlab) PlusUsernames(projID int, mrIID int) (usernames []string, err error)

PlusUsernames get the username who +1

func (*Gitlab) ProjectID

func (g *Gitlab) ProjectID(url string) (projID int, err error)

ProjectID get project id by project URL-encoded name

func (*Gitlab) RepoRawFile

func (g *Gitlab) RepoRawFile(projID int, branch string, filename string) (content []byte, err error)

RepoRawFile ...

func (*Gitlab) TakeOwnership

func (g *Gitlab) TakeOwnership(projectID int, triggerID int) (trigger *gitlab.PipelineTrigger, err error)

TakeOwnership take ownership of the trigger

func (*Gitlab) TriggerPipeline

func (g *Gitlab) TriggerPipeline(projectID int, ref string, token string) (pipeline *gitlab.Pipeline, err error)

TriggerPipeline trigger the pipeline

func (*Gitlab) Triggers

func (g *Gitlab) Triggers(projectID int) (triggers []*gitlab.PipelineTrigger, err error)

Triggers get pipeline triggers

func (*Gitlab) UpdateMRNote

func (g *Gitlab) UpdateMRNote(projID int, mrIID int, noteID int, content string) (err error)

UpdateMRNote update the specified merge request note

func (*Gitlab) UserName

func (g *Gitlab) UserName(userID int) (userName string, err error)

UserName get user name for user id

Jump to

Keyboard shortcuts

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