Documentation
¶
Index ¶
- type Echo
- func (e *Echo) Abs(path string) string
- func (e *Echo) AreSame(path0, path1 string) bool
- func (e *Echo) Base(path string) string
- func (e *Echo) Dir(path string) string
- func (e *Echo) Empty(val string) bool
- func (e *Echo) Env(val string) *Echo
- func (e *Echo) Eval(str string) string
- func (e *Echo) Ext(path string) string
- func (e *Echo) Glob(pathPattern string) []string
- func (e *Echo) IsAbs(path string) bool
- func (e *Echo) IsDir(path string) bool
- func (e *Echo) IsExist(path string) bool
- func (e *Echo) IsReg(path string) bool
- func (e *Echo) Lower(val string) string
- func (e *Echo) Mkdirs(paths string, modes ...uint32)
- func (e *Echo) PathJoin(paths ...string) string
- func (e *Echo) PathMatched(pattern, path string) bool
- func (e *Echo) PathSplit(path string) []string
- func (e *Echo) PathSym(path string) string
- func (e *Echo) Rel(base string, target string) string
- func (e *Echo) Rmdirs(paths string)
- func (e *Echo) Run(cmdStr string) string
- func (e *Echo) Runout(cmdStr string)
- func (e *Echo) SetEnv(name, value string) *Echo
- func (e *Echo) SetVar(name, value string) *Echo
- func (e *Echo) Split(list string, sep ...string) []string
- func (e *Echo) Streq(val0, val1 string) bool
- func (e *Echo) String() string
- func (e *Echo) Trim(val string) string
- func (e *Echo) Upper(val string) string
- func (e *Echo) Val(name string) string
- func (e *Echo) Var(val string) *Echo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Echo ¶
type Echo struct {
Conf *conf
// contains filtered or unexported fields
}
Echo represents a new Echo session
func (*Echo) Abs ¶
Abs returns the absolute representation for path. Returns empty string if it fails for any reason.
func (*Echo) Env ¶
Env declares process environment variables using a multi-line space-separated list of KEY=VAL format: i.e. GOOS=linux GOARCH=amd64
func (*Echo) Eval ¶
Eval returns the string str with its content expanded with variable values i.e. Eval("I am $HOME") returns "I am <user home path>"
func (*Echo) Glob ¶
Glob uses shell file path pattern (i.e. /usr/*/*a) to return a []string of file names
func (*Echo) IsDir ¶
IsDir returns true if path is a directory. All other cases (errors) will return false.
func (*Echo) IsExist ¶
IsExist returns true if file is 1) accessible 2) exists. All other conditions returns false.
func (*Echo) IsReg ¶
IsReg returns true if path is a regular file. All other cases (errors) will return false.
func (*Echo) Mkdirs ¶
Mkdirs creates one or more space-separated directories using the optional filemods. If no mode is provided, it defaults to 0777. When mode is provided only modes[0] is applied.
func (*Echo) PathMatched ¶
PathMatched returns true if path matches shell file pattern
func (*Echo) PathSym ¶
PathSym returns the evaluated symbolic link for path. Returns empty if symbolic evaluation fails.
func (*Echo) Rel ¶
Rel returns path that is relative to base/target. Returns an empty path if error.
func (*Echo) Run ¶
Run parses and executes command cmdStr and returns the result from stdout or stderr
func (*Echo) Split ¶
Split splits a space-separated (default) string into []string. An optional separator sep maybe provided as well.