Documentation
¶
Index ¶
- Constants
- func CleanWorkspace(username, pipelineName string, log *zap.SugaredLogger) error
- func CodehostListBranches(codehostID int, projectName, namespace string, log *zap.SugaredLogger) ([]*gitlab.Branch, error)
- func CodehostListNamespaces(codehostID int, keyword string, log *zap.SugaredLogger) ([]*gitlab.Namespace, error)
- func CodehostListPRs(codehostID int, projectName, namespace, targetBr string, ...) ([]*gitlab.MergeRequest, error)
- func CodehostListProjects(codehostID int, namespace, namespaceType, keyword string, ...) ([]*gitlab.Project, error)
- func CodehostListTags(codehostID int, projectName string, namespace string, log *zap.SugaredLogger) ([]*gitlab.Tag, error)
- func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
- type CodehostFileInfo
- type FileInfo
- type GitRepoInfo
- type RepoInfoList
Constants ¶
View Source
const ( OrgKind = "org" GroupKind = "group" UserKind = "user" )
Variables ¶
This section is empty.
Functions ¶
func CleanWorkspace ¶
func CleanWorkspace(username, pipelineName string, log *zap.SugaredLogger) error
func CodehostListBranches ¶
func CodehostListNamespaces ¶
func CodehostListPRs ¶
func CodehostListPRs(codehostID int, projectName, namespace, targetBr string, log *zap.SugaredLogger) ([]*gitlab.MergeRequest, error)
func CodehostListProjects ¶
func CodehostListTags ¶
func GetWorkspaceFilePath ¶
func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
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 GetGithubRepoInfo ¶
func GetGithubRepoInfo(codehostID int, repoName, branchName, path string, log *zap.SugaredLogger) ([]*CodehostFileInfo, error)
func GetGitlabRepoInfo ¶
func GetGitlabRepoInfo(codehostID int, repoName, branchName, path string, log *zap.SugaredLogger) ([]*CodehostFileInfo, error)
获取gitlab的目录内容接口
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 ¶
func GetPublicGitRepoInfo ¶
func GetPublicGitRepoInfo(urlPath, dir string, log *zap.SugaredLogger) ([]*FileInfo, error)
type GitRepoInfo ¶
type GitRepoInfo struct {
Owner string `json:"repo_owner"`
Repo string `json:"repo"`
CodehostID int `json:"codehost_id"`
Source string `json:"source"`
DefaultBranch string `json:"default_branch"`
ErrorMsg string `json:"error_msg"` // repo信息是否拉取成功
Branches []*gitlab.Branch `json:"branches"`
Tags []*gitlab.Tag `json:"tags"`
//Releases []*GitRelease `json:"releases"`
PRs []*gitlab.MergeRequest `json:"prs"`
}
func ListRepoInfos ¶
func ListRepoInfos(infos []*GitRepoInfo, param string, log *zap.SugaredLogger) ([]*GitRepoInfo, error)
ListRepoInfos ...
type RepoInfoList ¶
type RepoInfoList struct {
Infos []*GitRepoInfo `json:"infos"`
}
Click to show internal directories.
Click to hide internal directories.