gitlab

package
v0.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitlab

func NewGitlab(scmCfg *api.SCMConfig) (scm.SCMProvider, error)

NewGitlab news Gitlab v3 or v4 client according to the API version detected from Gitlab server,

func NewGitlabV4

func NewGitlabV4(scmCfg *api.SCMConfig) (scm.SCMProvider, error)

Types

type GitlabV3

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

GitlabV3 represents the SCM provider of GitlabV3 with API V3.

func (*GitlabV3) CheckToken

func (g *GitlabV3) CheckToken() bool

CheckToken checks whether the token has the authority of repo by trying ListRepos with the token.

func (*GitlabV3) CreateStatus

func (g *GitlabV3) CreateStatus(recordStatus api.Status, targetURL, repoURL, commitSha string) error

CreateStatus generate a new status for repository.

func (*GitlabV3) CreateWebHook

func (g *GitlabV3) CreateWebHook(repoURL string, webHook *scm.WebHook) error

CreateWebHook creates webhook for specified repo.

func (*GitlabV3) DeleteWebHook

func (g *GitlabV3) DeleteWebHook(repoURL string, webHookUrl string) error

DeleteWebHook deletes webhook from specified repo.

func (*GitlabV3) GetTemplateType

func (g *GitlabV3) GetTemplateType(repo string) (string, error)

func (*GitlabV3) GetToken

func (g *GitlabV3) GetToken() (string, error)

GetToken gets the token by the username and password of SCM config.

func (*GitlabV3) ListBranches

func (g *GitlabV3) ListBranches(repo string) ([]string, error)

ListBranches lists the branches for specified repo.

func (*GitlabV3) ListRepos

func (g *GitlabV3) ListRepos() ([]api.Repository, error)

ListRepos lists the repos by the SCM config.

func (*GitlabV3) ListTags

func (g *GitlabV3) ListTags(repo string) ([]string, error)

ListTags lists the tags for specified repo.

func (*GitlabV3) NewTagFromLatest

func (g *GitlabV3) NewTagFromLatest(tagName, description, commitID, url string) error

NewTagFromLatest generate a new tag

type GitlabV4

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

GitlabV4 represents the SCM provider of Gitlab with API V4.

func (*GitlabV4) CheckToken

func (g *GitlabV4) CheckToken() bool

CheckToken checks whether the token has the authority of repo by trying ListRepos with the token.

func (*GitlabV4) CreateStatus

func (g *GitlabV4) CreateStatus(recordStatus api.Status, targetURL, repoURL, commitSha string) error

CreateStatus generate a new status for repository.

func (*GitlabV4) CreateWebHook

func (g *GitlabV4) CreateWebHook(repoURL string, webHook *scm.WebHook) error

CreateWebHook creates webhook for specified repo.

func (*GitlabV4) DeleteWebHook

func (g *GitlabV4) DeleteWebHook(repoURL string, webHookUrl string) error

DeleteWebHook deletes webhook from specified repo.

func (*GitlabV4) GetTemplateType

func (g *GitlabV4) GetTemplateType(repo string) (string, error)

GetTemplateType get template type of repo

func (*GitlabV4) GetToken

func (g *GitlabV4) GetToken() (string, error)

GetToken gets the token by the username and password of SCM config.

func (*GitlabV4) ListBranches

func (g *GitlabV4) ListBranches(repo string) ([]string, error)

ListBranches lists the branches for specified repo.

func (*GitlabV4) ListRepos

func (g *GitlabV4) ListRepos() ([]api.Repository, error)

ListRepos lists the repos by the SCM config.

func (*GitlabV4) ListTags

func (g *GitlabV4) ListTags(repo string) ([]string, error)

ListTags lists the tags for specified repo.

func (*GitlabV4) NewTagFromLatest

func (g *GitlabV4) NewTagFromLatest(tagName, description, commitID, url string) error

NewTagFromLatest generate a new tag

type RepoFile

type RepoFile struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
	Path string `json:"path,omitempty"`
}

Jump to

Keyboard shortcuts

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