Documentation
¶
Index ¶
- Constants
- func BatchPull()
- type Config
- func (c *Config) BuildRepoURL(repoPath string, useSsh bool) string
- func (c *Config) Clone() *Config
- func (c *Config) Init() *Config
- func (c *Config) IsCenterRemote(remote string) bool
- func (c *Config) IsDefaultRemote(remote string) bool
- func (c *Config) IsForkMode() bool
- func (c *Config) IsSourceRemote(remote string) bool
- func (c *Config) LoadRepo(repoDir string) *GitLoc
- func (c *Config) OriginBranch(br string) string
- func (c *Config) ResolveAlias(name string) string
- func (c *Config) ResolveBranch(name string) string
- func (c *Config) SourceBranch(br string) string
- type ConfigProviderFn
- type GitBatchRun
- type GitLoc
- func (g *GitLoc) Check() error
- func (g *GitLoc) CheckRemote() error
- func (g *GitLoc) DefRemoteInfo() *gitw.RemoteInfo
- func (g *GitLoc) FetchOrigin() error
- func (g *GitLoc) FetchSource() error
- func (g *GitLoc) HasDefaultBranch(br string) bool
- func (g *GitLoc) HasDefaultRemote() bool
- func (g *GitLoc) HasOriginBranch(br string) bool
- func (g *GitLoc) HasSourceBranch(br string) bool
- func (g *GitLoc) HasSourceRemote() bool
- func (g *GitLoc) RepoDir() string
- func (g *GitLoc) ResolveBranch(brName string) (string, bool)
- func (g *GitLoc) SrcRemoteInfo() *gitw.RemoteInfo
Constants ¶
View Source
const ( HostGitHub = "github" HostGitlab = "gitlab" HostDefault = "git" )
View Source
const ( GitHubHost = "github.com" GitHubURL = "https://github.com" DefaultSrcRemote = "main" DefaultOriRemote = "origin" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// GitUrl ssh git host url
GitUrl string `json:"git_url"`
// HostUrl http host url. eg: https://gitlab.myself.com
HostUrl string `json:"host_url"`
// HostType eg: HostGitHub
HostType string `json:"host_type"`
// AutoSign auto add author sign on commit
AutoSign bool `json:"auto_sign"`
// ForkMode enable git fork mode for develop.
// If is False, use branch mode, will ignore SourceRemote setting.
ForkMode bool `json:"fork_mode"`
// DisableHTTPS disable https(eg: on PR/MR link). if is true, will use HTTP url.
DisableHTTPS bool `json:"disable_https"`
// SourceRemote the source remote name, it is center repo.
SourceRemote string `json:"source_remote"`
// DefaultRemote the default upstream remote name, use for develop. default: origin.
// It should be forked from SourceRemote.
DefaultRemote string `json:"default_remote"`
// DefaultBranch name, default is gitw.DefaultBranchName
DefaultBranch string `json:"default_branch"`
// BranchAliases branch aliases
BranchAliases maputil.Aliases `json:"branch_aliases"`
// PrUrlFormat pull request URL format template. can use var like {host}
PrUrlFormat string `json:"pr_url_format"`
}
Config for gitx
func (*Config) BuildRepoURL ¶
BuildRepoURL build
func (*Config) IsCenterRemote ¶
func (*Config) IsDefaultRemote ¶
func (*Config) IsSourceRemote ¶
func (*Config) OriginBranch ¶
OriginBranch name build
func (*Config) ResolveAlias ¶
ResolveAlias branch name
func (*Config) ResolveBranch ¶
ResolveBranch branch name
func (*Config) SourceBranch ¶
SourceBranch name build
type GitBatchRun ¶
type GitBatchRun struct {
}
GitBatchRun struct
func NewBatchRun ¶
func NewBatchRun(fn ...func(gbr *GitBatchRun)) *GitBatchRun
type GitLoc ¶
GitLoc repo struct
func (*GitLoc) DefRemoteInfo ¶
func (g *GitLoc) DefRemoteInfo() *gitw.RemoteInfo
DefRemoteInfo data.
func (*GitLoc) HasDefaultBranch ¶
HasDefaultBranch check
func (*GitLoc) HasDefaultRemote ¶
func (*GitLoc) HasOriginBranch ¶
HasOriginBranch check
func (*GitLoc) HasSourceBranch ¶
HasSourceBranch check
func (*GitLoc) HasSourceRemote ¶
func (*GitLoc) ResolveBranch ¶
ResolveBranch name
func (*GitLoc) SrcRemoteInfo ¶
func (g *GitLoc) SrcRemoteInfo() *gitw.RemoteInfo
SrcRemoteInfo data.
Click to show internal directories.
Click to hide internal directories.