Documentation ¶
Index ¶
- Constants
- func CleanWorkspace(username, pipelineName string, log *zap.SugaredLogger) error
- func CodeHostListBranches(codeHostID int, projectName, namespace, key string, page, perPage int, ...) ([]*client.Branch, error)
- func CodeHostListNamespaces(codeHostID int, keyword string, log *zap.SugaredLogger) ([]*client.Namespace, error)
- func CodeHostListPRs(codeHostID int, projectName, namespace, targetBr string, key string, ...) ([]*client.PullRequest, error)
- func CodeHostListProjects(codeHostID int, namespace, namespaceType string, page, perPage int, ...) ([]*client.Project, error)
- func CodeHostListTags(codeHostID int, projectName string, namespace string, key string, page int, ...) ([]*client.Tag, error)
- func GetContents(codeHostID int, owner, repo, path, branch string, isDir bool, ...) (string, error)
- func GetPublicRepoTree(repoLink, path string, logger *zap.SugaredLogger) ([]*git.TreeNode, error)
- func GetRepoTree(codeHostID int, owner, repo, path, branch string, logger *zap.SugaredLogger) ([]*git.TreeNode, error)
- func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
- func MatchBranchesList(regular string, branches []string) []string
- type CodehostFileInfo
- type FileInfo
- type GitRepoInfo
- type RepoInfoList
Constants ¶
View Source
const ( OrgKind = "org" GroupKind = "group" UserKind = "user" EnterpriseKind = "enterprise" CodeHostCodeHub = "codehub" )
Variables ¶
This section is empty.
Functions ¶
func CleanWorkspace ¶
func CleanWorkspace(username, pipelineName string, log *zap.SugaredLogger) error
func CodeHostListBranches ¶ added in v1.2.0
func CodeHostListNamespaces ¶ added in v1.2.0
func CodeHostListPRs ¶ added in v1.2.0
func CodeHostListPRs(codeHostID int, projectName, namespace, targetBr string, key string, page, perPage int, log *zap.SugaredLogger) ([]*client.PullRequest, error)
func CodeHostListProjects ¶ added in v1.2.0
func CodeHostListTags ¶ added in v1.2.0
func GetContents ¶ added in v1.9.9
func GetPublicRepoTree ¶ added in v1.5.0
func GetRepoTree ¶ added in v1.4.0
func GetWorkspaceFilePath ¶
func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
func MatchBranchesList ¶ added in v1.6.0
Types ¶
type CodehostFileInfo ¶
type CodehostFileInfo struct { Name string `json:"name"` Size int `json:"size"` IsDir bool `json:"is_dir"` FullPath string `json:"full_path"` }
func GetCodehubRepoInfo ¶ added in v1.3.0
func GetCodehubRepoInfo(codehostID int, repoUUID, branchName, path string, log *zap.SugaredLogger) ([]*CodehostFileInfo, error)
获取codehub的目录内容接口
type FileInfo ¶
type FileInfo struct { // parent path of the file Parent string `json:"parent"` // base name of the file Name string `json:"name"` // length in bytes for regular files; system-dependent for others Size int64 `json:"size"` // file mode bits Mode os.FileMode `json:"mode"` // modification time ModTime int64 `json:"mod_time"` // abbreviation for Mode().IsDir() IsDir bool `json:"is_dir"` }
func GetGitRepoInfo ¶
type GitRepoInfo ¶
type GitRepoInfo struct { Owner string `json:"repo_owner"` Namespace string `json:"repo_namespace"` Repo string `json:"repo"` CodehostID int `json:"codehost_id"` Source string `json:"source"` DefaultBranch string `json:"default_branch"` ErrorMsg string `json:"error_msg"` // get repo message fail message Branches []*client.Branch `json:"branches"` Tags []*client.Tag `json:"tags"` PRs []*client.PullRequest `json:"prs"` ProjectUUID string `json:"project_uuid,omitempty"` RepoUUID string `json:"repo_uuid,omitempty"` RepoID string `json:"repo_id,omitempty"` Key string `json:"key"` // FilterRegexp is the regular expression filter for the branches and tags FilterRegexp string `json:"filter_regexp,omitempty"` }
func ListRepoInfos ¶
func ListRepoInfos(infos []*GitRepoInfo, log *zap.SugaredLogger) ([]*GitRepoInfo, error)
ListRepoInfos ...
func (*GitRepoInfo) GetNamespace ¶ added in v1.9.9
func (repo *GitRepoInfo) GetNamespace() string
type RepoInfoList ¶
type RepoInfoList struct {
Infos []*GitRepoInfo `json:"infos"`
}
Click to show internal directories.
Click to hide internal directories.