Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + var GlobalConfigFile = "config" + var GlobalErdaDir = ".erda.d" + var InvalidErdaRepo = errors.New("Invalid Erda git repository!") + var NotExist = errors.New("not exist") + var ProjectDiceDir = ".dice" + var ProjectErdaConfigDir = ".erda.d" + var ProjectErdaDir = ".erda" + var ProjectPipelineDir = ".dice/pipelines" + func CreateGlobalErdaDir() (string, error) + func CreateProjectDiceDir() (string, error) + func CreateProjectErdaDir() (string, error) + func DoTaskListWithTimeout(timeout time.Duration, rs []TaskRunner) error + func DoTaskWithTimeout(c TaskRunnerE, timeout time.Duration) error + func FindGlobalConfig() (string, error) + func FindGlobalErdaDir() (string, error) + func FindProjectConfig() (string, error) + func FindProjectDiceDir() (string, error) + func FindProjectErdaDir() (string, error) + func Format(data []byte) ([]byte, error) + func FormatErrMsg(name string, str string, withHelp bool) string + func FormatMemOutput(mem uint64) string + func GetOriginRepo() string + func GetRepo(remote string) string + func GetWorkspaceBranch(dir string) (string, error) + func GetWorkspacePipelines(dir string) ([]string, error) + func InputAndChoose(prompt, yes, no string) string + func InputNormal(prompt string) string + func InputPWD(prompt string) string + func IsDir(path string) bool + func IsWorkspaceDirty(dir string) (bool, error) + func ListDir(dir string) ([]string, error) + func Marshal(v interface{}) ([]byte, error) + func PagingAll(p pagingList, pageSize int) error + func PagingView(p pagingList, choose string, pageSize int, interactive bool) error + func PipeCmds(cur, next *exec.Cmd) (string, error) + func ReadYml(path string) ([]byte, error) + func ShortID(id string) string + func Time(t interface{}) string + func ToTimeSpanString(seconds int) string + type ApplicationURLInfo struct + ApplicationId uint64 + type Err struct + Code string + Ctx interface{} + Msg string + type Formatter struct + BoolColor *color.Color + DisabledColor bool + Indent int + KeyColor *color.Color + Newline string + NullColor *color.Color + NumberColor *color.Color + StringColor *color.Color + StringMaxLength int + func NewFormatter() *Formatter + func (f *Formatter) Format(data []byte) ([]byte, error) + func (f *Formatter) Marshal(v interface{}) ([]byte, error) + type GitterURLInfo struct + Application string + Project string + func GetWorkspaceInfo(dir, remoteName string) (GitterURLInfo, error) + type OrganizationURLInfo struct + Host string + Org string + Scheme string + type Page struct + List json.RawMessage + Total int + type ProjectURLInfo struct + ProjectId uint64 + type Resp struct + Data json.RawMessage + Err *Err + Success bool + func DoResp(r *httpclient.Request) (Resp, error) + func (resp *Resp) ParseData(o interface{}) error + func (resp *Resp) ParsePagingListData(o interface{}) error + type TaskRunner func() bool + type TaskRunnerE func() (bool, error) + type URLType string + var ApplicatinURL URLType = "ErdaApplicationURL" + var GittarURL URLType = "ErdaGittarURL" + var OrgURL URLType = "ErdaOrganizationURL" + var ProjectURL URLType = "ErdaProjectURL" + func ClassifyURL(path string) (URLType, []string, error)