Documentation ¶
Index ¶
- Variables
- type Cmd
- func (c *Cmd) Do(ctx context.Context, env []string, args ...string) (string, error)
- func (c *Cmd) DoCmd(ctx context.Context, env []string, args ...string) (string, error)
- func (c *Cmd) IsRepo(ctx context.Context, env []string) bool
- func (c *Cmd) Version(ctx context.Context, env []string) string
- func (c *Cmd) VersionNumber(ctx context.Context, env []string) string
- type Git
- func (g *Git) Checkout(name string) (err error)
- func (g *Git) CleanBranch() (err error)
- func (g *Git) Clone() (r *git.Repository, err error)
- func (g *Git) CloneOptions() (opt git.CloneOptions, err error)
- func (g *Git) CreateBranch() (branchShortName, branchName string, err error)
- func (g *Git) CreateBranchName() (name string, err error)
- func (g *Git) Fetch() (r *git.Repository, err error)
- func (g *Git) FetchOptions() (opt git.FetchOptions, err error)
- func (g *Git) GetAuth() (auth transport.AuthMethod, err error)
- func (g *Git) GetHash() (hash string, hashObj plumbing.Hash, r *git.Repository, ref *plumbing.Reference, ...)
- func (g *Git) IsHTTP() bool
- func (g *Git) IsNeedAuth() bool
- func (g *Git) LastCommitId() (hash string, err error)
- func (g *Git) Publish() (commitId string, err error)
- func (g *Git) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ArgsCommitLog = []string{"log", "--pretty=format:\"%h\"", "-1"} ArgsCommit = []string{"rev-parse", "--short", "HEAD"} ArgsDirty = []string{"status", "--porcelain"} ArgsBranch = []string{"rev-parse", "--abbrev-ref", "HEAD"} ArgsDescribe = []string{"describe", "--tags", "--always"} ArgsTag = []string{"describe", "--abbrev=0", "--tags"} )
Functions ¶
This section is empty.
Types ¶
type Cmd ¶ added in v1.8.68
type Cmd struct { }
type Git ¶
type Git struct { Url string `json:"url"` SshKey string `json:"ssh_key"` SshKeySalt string `json:"ssh_key_salt"` Path string `json:"path"` Branch string `json:"branch"` Username string `json:"username"` Password string `json:"password"` DirUser string `json:"dir_user"` }
func (*Git) CleanBranch ¶
func (*Git) CloneOptions ¶
func (*Git) CreateBranch ¶
CreateBranch 创建分支
func (*Git) CreateBranchName ¶
func (*Git) FetchOptions ¶
func (*Git) GetHash ¶
func (g *Git) GetHash() (hash string, hashObj plumbing.Hash, r *git.Repository, ref *plumbing.Reference, err error)
GetHash 获取 hash
func (*Git) IsNeedAuth ¶
func (*Git) LastCommitId ¶
Click to show internal directories.
Click to hide internal directories.