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 CodeHostListCommits(codeHostID int, projectName, namespace, targetBranch string, page, perPage int, ...) ([]*client.Commit, error)
- func CodeHostListNamespaces(codeHostID int, keyword string, log *zap.SugaredLogger) ([]*client.Namespace, error)
- func CodeHostListPRs(codeHostID int, projectName, namespace, targetBranch 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" )
Variables ¶
This section is empty.
Functions ¶
func CleanWorkspace ¶
func CleanWorkspace(username, pipelineName string, log *zap.SugaredLogger) error
func CodeHostListBranches ¶
func CodeHostListCommits ¶
func CodeHostListNamespaces ¶
func CodeHostListPRs ¶
func CodeHostListPRs(codeHostID int, projectName, namespace, targetBranch string, key string, page, perPage int, log *zap.SugaredLogger) ([]*client.PullRequest, error)
func CodeHostListProjects ¶
func CodeHostListTags ¶
func GetContents ¶
func GetPublicRepoTree ¶
func GetRepoTree ¶
func GetWorkspaceFilePath ¶
func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
func MatchBranchesList ¶
Types ¶
type CodehostFileInfo ¶
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 ¶
func (repo *GitRepoInfo) GetNamespace() string
type RepoInfoList ¶
type RepoInfoList struct {
Infos []*GitRepoInfo `json:"infos"`
}
Click to show internal directories.
Click to hide internal directories.