Documentation ¶
Index ¶
- Variables
- 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
- type Err
- type Formatter
- type GitterURLInfo
- type OrganizationURLInfo
- type Page
- type ProjectURLInfo
- type Resp
- type TaskRunner
- type TaskRunnerE
- type URLType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NotExist = errors.New("not exist") GlobalErdaDir = ".erda.d" GlobalConfigFile = "config" ProjectDiceDir = ".dice" ProjectPipelineDir = ".dice/pipelines" ProjectErdaDir = ".erda" ProjectErdaConfigDir = ".erda.d" )
View Source
var InvalidErdaRepo = errors.New("Invalid Erda git repository!")
Functions ¶
func CreateGlobalErdaDir ¶
func CreateProjectDiceDir ¶
func CreateProjectErdaDir ¶
func DoTaskListWithTimeout ¶
func DoTaskListWithTimeout(timeout time.Duration, rs []TaskRunner) error
func DoTaskWithTimeout ¶
func DoTaskWithTimeout(c TaskRunnerE, timeout time.Duration) error
func FindGlobalConfig ¶
func FindGlobalErdaDir ¶
func FindProjectConfig ¶
func FindProjectDiceDir ¶
func FindProjectErdaDir ¶
func FormatMemOutput ¶
func GetOriginRepo ¶
func GetOriginRepo() string
func GetWorkspaceBranch ¶
func GetWorkspacePipelines ¶
func InputAndChoose ¶
func InputNormal ¶
func IsWorkspaceDirty ¶
func PagingView ¶
func ToTimeSpanString ¶
Types ¶
type ApplicationURLInfo ¶
type ApplicationURLInfo struct { ProjectURLInfo ApplicationId uint64 }
type Formatter ¶
type Formatter struct { // JSON key color. Default is `color.New(color.FgBlue, color.Bold)`. KeyColor *color.Color // JSON string value color. Default is `color.New(color.FgGreen, color.Bold)`. StringColor *color.Color // JSON boolean value color. Default is `color.New(color.FgYellow, color.Bold)`. BoolColor *color.Color // JSON number value color. Default is `color.New(color.FgCyan, color.Bold)`. NumberColor *color.Color // JSON null value color. Default is `color.New(color.FgBlack, color.Bold)`. NullColor *color.Color // Max length of JSON string value. When the value is 1 and over, string is truncated to length of the value. // Default is 0 (not truncated). StringMaxLength int // Boolean to disable color. Default is false. DisabledColor bool // Indent space number. Default is 2. Indent int // Newline string. To print without new lines set it to empty string. Default is \n. Newline string }
Formatter is a struct to format JSON data. `color` is github.com/fatih/color: https://github.com/fatih/color
func NewFormatter ¶
func NewFormatter() *Formatter
NewFormatter returns a new formatter with following default values.
type GitterURLInfo ¶
type GitterURLInfo struct { OrganizationURLInfo Project string Application string }
func GetWorkspaceInfo ¶
func GetWorkspaceInfo(dir, remoteName string) (GitterURLInfo, error)
type OrganizationURLInfo ¶
type Page ¶
type Page struct { Total int List json.RawMessage }
type ProjectURLInfo ¶
type ProjectURLInfo struct { OrganizationURLInfo ProjectId uint64 }
type Resp ¶
type Resp struct { Success bool Data json.RawMessage Err *Err }
func (*Resp) ParsePagingListData ¶
type TaskRunner ¶
type TaskRunner func() bool
type TaskRunnerE ¶
Click to show internal directories.
Click to hide internal directories.