Documentation ¶
Index ¶
- Constants
- func CleanWorkspace(username, pipelineName string, log *zap.SugaredLogger) error
- func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
- type Branch
- type CodehostFileInfo
- type FileInfo
- type GitRepoInfo
- type Namespace
- type Project
- type PullRequest
- type RepoInfoList
- type Tag
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 GetWorkspaceFilePath ¶
func GetWorkspaceFilePath(username, pipelineName, file string, log *zap.SugaredLogger) (string, error)
Types ¶
type Branch ¶ added in v1.2.0
type Branch struct { Name string `json:"name"` Protected bool `json:"protected"` Merged bool `json:"merged"` }
func CodeHostListBranches ¶ added in v1.2.0
func ToBranches ¶ added in v1.2.0
func ToBranches(obj interface{}) []*Branch
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 []*Branch `json:"branches"` Tags []*Tag `json:"tags"` PRs []*PullRequest `json:"prs"` }
func ListRepoInfos ¶
func ListRepoInfos(infos []*GitRepoInfo, param string, log *zap.SugaredLogger) ([]*GitRepoInfo, error)
ListRepoInfos ...
type Namespace ¶ added in v1.2.0
type Namespace struct { Name string `json:"name"` Path string `json:"path"` Kind string `json:"kind"` }
func CodeHostListNamespaces ¶ added in v1.2.0
func ToNamespaces ¶ added in v1.2.0
func ToNamespaces(obj interface{}) []*Namespace
type Project ¶ added in v1.2.0
type Project struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` DefaultBranch string `json:"defaultBranch"` Namespace string `json:"namespace"` }
func CodeHostListProjects ¶ added in v1.2.0
func ToProjects ¶ added in v1.2.0
func ToProjects(obj interface{}) []*Project
type PullRequest ¶ added in v1.2.0
type PullRequest struct { ID int `json:"id"` TargetBranch string `json:"targetBranch"` SourceBranch string `json:"sourceBranch"` ProjectID int `json:"projectId"` Title string `json:"title"` State string `json:"state"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` AuthorUsername string `json:"authorUsername"` Number int `json:"number"` User string `json:"user"` Base string `json:"base,omitempty"` }
func CodeHostListPRs ¶ added in v1.2.0
func CodeHostListPRs(codeHostID int, projectName, namespace, targetBr string, log *zap.SugaredLogger) ([]*PullRequest, error)
func ToPullRequests ¶ added in v1.2.0
func ToPullRequests(obj interface{}) []*PullRequest
type RepoInfoList ¶
type RepoInfoList struct {
Infos []*GitRepoInfo `json:"infos"`
}
Click to show internal directories.
Click to hide internal directories.