gitlab

package
v0.0.0-...-9c55465 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectIdSep = "%2F"
)

Variables

This section is empty.

Functions

func BuildProjectID

func BuildProjectID(group, name string) string

BuildProjectID by group and name

func PathToProjectID

func PathToProjectID(pathWithName string) string

PathToProjectID convert

Types

type GitLab

type GitLab struct {
	*gitx.Config

	// BaseApi api url
	BaseApi string `json:"base_api"`
	// Token person token.
	// - from /profile/personal_access_tokens
	Token string `json:"token"`
	// BranchAliases branch aliases
	// BranchAliases maputil.Aliases `json:"branch_aliases"`
	// DenyBranches deny as source branch for create PR.
	DenyBranches map[string]string `json:"deny_branches"`
}

GitLab config struct for gitlab

Gen by:

kite go gen st -s @c -t yml --name GitLab

func New

func New(cfg *gitx.Config) *GitLab

New instance.

func (*GitLab) LocGlProject

func (g *GitLab) LocGlProject(dir string) *GlProject

LocGlProject instance

type GlProject

type GlProject struct {
	*GitLab
	// contains filtered or unexported fields
}

GlProject struct

func NewGlProject

func NewGlProject(dir string, gl *GitLab) *GlProject

NewGlProject instance

func (*GlProject) CheckDefaultRemote

func (p *GlProject) CheckDefaultRemote() error

func (*GlProject) CheckRemote

func (p *GlProject) CheckRemote() error

func (*GlProject) CheckSourceRemote

func (p *GlProject) CheckSourceRemote() error

func (*GlProject) ForkProjectId

func (p *GlProject) ForkProjectId() string

func (*GlProject) ForkRmtInfo

func (p *GlProject) ForkRmtInfo() *gitw.RemoteInfo

func (*GlProject) GitLoc

func (p *GlProject) GitLoc() *gitx.GitLoc

GitLoc instance

func (*GlProject) MainProjectId

func (p *GlProject) MainProjectId() string

func (*GlProject) MainRmtInfo

func (p *GlProject) MainRmtInfo() *gitw.RemoteInfo

func (*GlProject) ResolveBranch

func (p *GlProject) ResolveBranch(brName string) (string, bool)

ResolveBranch name

func (*GlProject) SetMainProjId

func (p *GlProject) SetMainProjId(mainProjId string)

type GlabApiV4

type GlabApiV4 struct {
}

GlabApiV4 struct

func NewApiV4

func NewApiV4() *GlabApiV4

type PRLinkBuilder

type PRLinkBuilder struct {
	HostUrl     string
	RepoPath    string
	QueryString string
}

PRLinkBuilder struct

type PRLinkQuery

type PRLinkQuery struct {
	RepoPath string
	// SourceProjectId int or urlencode(group/name)
	SourceProjectId string `json:"source_project_id"`
	SourceBranch    string `json:"source_branch"`
	// TargetProjectId int or urlencode(group/name)
	TargetProjectId string `json:"target_project_id"`
	TargetBranch    string `json:"target_branch"`
}

PRLinkQuery struct

func NewPRLinkQuery

func NewPRLinkQuery(srcPid, srcBr, dstPid, dstBr string) *PRLinkQuery

NewPRLinkQuery instance

func (*PRLinkQuery) BuildURL

func (b *PRLinkQuery) BuildURL(hostUrl string) string

BuildURL pr link url

func (*PRLinkQuery) QueryString

func (b *PRLinkQuery) QueryString() string

QueryString build query string.

Jump to

Keyboard shortcuts

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