service

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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 CodehostListBranches(codehostID int, projectName, namespace string, log *zap.SugaredLogger) ([]*gitlab.Branch, error)

func CodehostListNamespaces

func CodehostListNamespaces(codehostID int, keyword string, log *zap.SugaredLogger) ([]*gitlab.Namespace, error)

func CodehostListPRs

func CodehostListPRs(codehostID int, projectName, namespace, targetBr string, log *zap.SugaredLogger) ([]*gitlab.MergeRequest, error)

func CodehostListProjects

func CodehostListProjects(codehostID int, namespace, namespaceType, keyword string, log *zap.SugaredLogger) ([]*gitlab.Project, error)

func CodehostListTags

func CodehostListTags(codehostID int, projectName string, namespace string, log *zap.SugaredLogger) ([]*gitlab.Tag, error)

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 GetGitRepoInfo(codehostID int, repoOwner, repoName, branchName, remoteName, dir string, log *zap.SugaredLogger) ([]*FileInfo, error)

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL