Versions in this module Expand all Collapse all v1 v1.0.0 Dec 13, 2023 Changes in this version + func GetCodeOwnerRepo(codeUrl string) (string, string, error) + type Client interface + Auth func() (transport.AuthMethod, error) + Clone func(ctx context.Context, repoDir string, isBare bool, options *git.CloneOptions) (*git.Repository, error) + CreateTag func(ctx context.Context, codeUrl, commitId, tagName string) error + GetBranchLatestCommit func(ctx context.Context, codeUrl, branch string) (*Commit, error) + ListRepoBranches func(ctx context.Context, codeUrl string) ([]*Reference, error) + ListRepositories func(ctx context.Context) ([]*Repository, error) + func NewClient(gitType string, apiUrl string, secret *types.Secret) (Client, error) + type Commit struct + Author string + Branch string + CommitId string + CommitTime time.Time + Message string + type Git struct + func NewGit(secret *types.Secret) *Git + func (g *Git) Auth() (transport.AuthMethod, error) + func (g *Git) Clone(ctx context.Context, repoDir string, isBare bool, options *git.CloneOptions) (*git.Repository, error) + func (g *Git) CreateTag(ctx context.Context, codeUrl, commitId, tagName string) error + func (g *Git) GetBranchLatestCommit(ctx context.Context, codeUrl, branch string) (*Commit, error) + func (g *Git) ListRepoBranches(ctx context.Context, codeUrl string) ([]*Reference, error) + func (g *Git) ListRepositories(ctx context.Context) ([]*Repository, error) + type Gitee struct + func NewGitee(accessToken string) (*Gitee, error) + func (g *Gitee) Auth() (transport.AuthMethod, error) + func (g *Gitee) Clone(ctx context.Context, repoDir string, isBare bool, options *git.CloneOptions) (*git.Repository, error) + func (g *Gitee) CreateTag(ctx context.Context, codeUrl, commitId, tagName string) error + func (g *Gitee) GetBranchLatestCommit(ctx context.Context, codeUrl, branch string) (*Commit, error) + func (g *Gitee) ListRepoBranches(ctx context.Context, codeUrl string) ([]*Reference, error) + func (g *Gitee) ListRepoPullRequests(ctx context.Context, codeUrl string) ([]*PullRequest, error) + func (g *Gitee) ListRepositories(ctx context.Context) ([]*Repository, error) + type GiteeBranchCommit struct + SHA string + Url string + type GiteeCommit struct + Commit struct{ ... } + HtmlUrl string + SHA string + Url string + type GiteeCreateTagRequest struct + AccessToken string + Refs string + TagName string + type GiteeListPullRequests struct + AccessToken string + State string + type GiteePullRequest struct + CreatedAt time.Time + Id int + Number int + State string + Title string + UpdatedAt time.Time + type GiteeRepoBranch struct + Commit *GiteeBranchCommit + Name string + Protected bool + ProtectedUrl string + type GiteeRepoBranchListQuery struct + AccessToken string + Owner string + Repo string + type GiteeRepository struct + FullName string + HtmlUrl string + Id int + Path string + type GiteeRepositoryListQuery struct + AccessToken string + type GiteeUser struct + Id int + Login string + Name string + type Github struct + func NewGitHub(accessToken string) (*Github, error) + func (g *Github) Auth() (transport.AuthMethod, error) + func (g *Github) Clone(ctx context.Context, repoDir string, isBare bool, options *git.CloneOptions) (*git.Repository, error) + func (g *Github) CreateTag(ctx context.Context, codeUrl, commitId, tagName string) error + func (g *Github) GetBranchLatestCommit(ctx context.Context, codeUrl, branch string) (*Commit, error) + func (g *Github) ListRepoBranches(ctx context.Context, codeUrl string) ([]*Reference, error) + func (g *Github) ListRepoPullRequests(ctx context.Context, codeUrl string) ([]*PullRequest, error) + func (g *Github) ListRepoRefs(ctx context.Context, codeUrl, matchRef string) ([]*Reference, error) + func (g *Github) ListRepositories(ctx context.Context) ([]*Repository, error) + type Gitlab struct + func NewGitLab(apiUrl, accessToken string) (*Gitlab, error) + func (g *Gitlab) Auth() (transport.AuthMethod, error) + func (g *Gitlab) Clone(ctx context.Context, repoDir string, isBare bool, options *git.CloneOptions) (*git.Repository, error) + func (g *Gitlab) CreateTag(ctx context.Context, codeUrl, commitId, tagName string) error + func (g *Gitlab) GetBranchLatestCommit(ctx context.Context, codeUrl, branch string) (*Commit, error) + func (g *Gitlab) GetPID(codeUrl string) (string, error) + func (g *Gitlab) ListRepoBranches(ctx context.Context, codeUrl string) ([]*Reference, error) + func (g *Gitlab) ListRepoPullRequests(ctx context.Context, codeUrl string) ([]*PullRequest, error) + func (g *Gitlab) ListRepositories(ctx context.Context) ([]*Repository, error) + type PullRequest struct + CreatedAt time.Time + Number int + State string + Title string + UpdatedAt time.Time + Username string + type Reference struct + CommitId string + Name string + Ref string + type Repository struct + CloneUrl string + FullName string + Name string