Documentation ¶
Index ¶
- func NewGitlab(scmCfg *api.SCMConfig) (scm.SCMProvider, error)
- func NewGitlabV4(scmCfg *api.SCMConfig) (scm.SCMProvider, error)
- type GitlabV3
- func (g *GitlabV3) CheckToken() bool
- func (g *GitlabV3) CreateStatus(recordStatus api.Status, targetURL, repoURL, commitSha string) error
- func (g *GitlabV3) CreateWebHook(repoURL string, webHook *scm.WebHook) error
- func (g *GitlabV3) DeleteWebHook(repoURL string, webHookUrl string) error
- func (g *GitlabV3) GetMergeRequestTargetBranch(repoURL string, number int) (string, error)
- func (g *GitlabV3) GetPullRequestSHA(repoURL string, number int) (string, error)
- func (g *GitlabV3) GetTemplateType(repo string) (string, error)
- func (g *GitlabV3) GetToken() (string, error)
- func (g *GitlabV3) ListBranches(repo string) ([]string, error)
- func (g *GitlabV3) ListDockerfiles(repo string) ([]string, error)
- func (g *GitlabV3) ListRepos() ([]api.Repository, error)
- func (g *GitlabV3) ListTags(repo string) ([]string, error)
- func (g *GitlabV3) NewTagFromLatest(tagName, description, commitID, url string) error
- func (g *GitlabV3) RetrieveRepoInfo(url string) (*api.RepoInfo, error)
- type GitlabV4
- func (g *GitlabV4) CheckToken() bool
- func (g *GitlabV4) CreateStatus(recordStatus api.Status, targetURL, repoURL, commitSha string) error
- func (g *GitlabV4) CreateWebHook(repoURL string, webHook *scm.WebHook) error
- func (g *GitlabV4) DeleteWebHook(repoURL string, webHookUrl string) error
- func (g *GitlabV4) GetMergeRequestTargetBranch(repoURL string, number int) (string, error)
- func (g *GitlabV4) GetPullRequestSHA(repoURL string, number int) (string, error)
- func (g *GitlabV4) GetTemplateType(repo string) (string, error)
- func (g *GitlabV4) GetToken() (string, error)
- func (g *GitlabV4) ListBranches(repo string) ([]string, error)
- func (g *GitlabV4) ListDockerfiles(repo string) ([]string, error)
- func (g *GitlabV4) ListRepos() ([]api.Repository, error)
- func (g *GitlabV4) ListTags(repo string) ([]string, error)
- func (g *GitlabV4) NewTagFromLatest(tagName, description, commitID, url string) error
- func (g *GitlabV4) RetrieveRepoInfo(url string) (*api.RepoInfo, error)
- type RepoFile
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 ¶
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 ¶
CreateWebHook creates webhook for specified repo.
func (*GitlabV3) DeleteWebHook ¶
DeleteWebHook deletes webhook from specified repo.
func (*GitlabV3) GetMergeRequestTargetBranch ¶
func (*GitlabV3) GetPullRequestSHA ¶
func (*GitlabV3) ListBranches ¶
ListBranches lists the branches for specified repo.
func (*GitlabV3) ListDockerfiles ¶
ListDockerfiles lists the Dockerfiles for specified repo.
func (*GitlabV3) ListRepos ¶
func (g *GitlabV3) ListRepos() ([]api.Repository, error)
ListRepos lists the repos by the SCM config.
func (*GitlabV3) NewTagFromLatest ¶
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 ¶
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 ¶
CreateWebHook creates webhook for specified repo.
func (*GitlabV4) DeleteWebHook ¶
DeleteWebHook deletes webhook from specified repo.
func (*GitlabV4) GetMergeRequestTargetBranch ¶
func (*GitlabV4) GetPullRequestSHA ¶
func (*GitlabV4) GetTemplateType ¶
GetTemplateType get template type of repo
func (*GitlabV4) ListBranches ¶
ListBranches lists the branches for specified repo.
func (*GitlabV4) ListDockerfiles ¶
ListDockerfiles lists the Dockerfiles for specified repo.
func (*GitlabV4) ListRepos ¶
func (g *GitlabV4) ListRepos() ([]api.Repository, error)
ListRepos lists the repos by the SCM config.
func (*GitlabV4) NewTagFromLatest ¶
NewTagFromLatest generate a new tag