Documentation ¶
Index ¶
- Constants
- Variables
- func AbsPath(path string) string
- func All2Str(v interface{}) (value string, ok bool)
- func Atoa(v interface{}) string
- func CheckMountPoint(mountPoint string) error
- func Choose(ok bool, first, second string) string
- func DeepCopy(src map[string]interface{}) map[string]interface{}
- func Diff(s1 string, s2 string) string
- func EncryptFile(srcfile, dstfile, secret string) error
- func ExecShell(format string, a ...interface{}) (string, error)
- func GetCurrentHomeDir() string
- func GetCurrentUser() string
- func GetFilePermissions(path string) int
- func IsBool(v interface{}) bool
- func IsFunc(v interface{}) bool
- func IsInt(v interface{}) bool
- func IsInt64(v interface{}) bool
- func IsString(v interface{}) bool
- func IsStringAnyMap(v interface{}) bool
- func IsTrueStr(s string) bool
- func IsValidAddress(address string) bool
- func Locate(s []string) map[string]int
- func MD5Sum(data string) string
- func Min(nums ...int) int
- func NewCommand(format string, a ...interface{}) *exec.Cmd
- func PathExist(path string) bool
- func RandFilename(dir string) string
- func RandString(n int) string
- func ReadFile(filename string) (string, error)
- func SetErr(cmd *cobra.Command, writer io.Writer)
- func SetFlagErrorFunc(cmd *cobra.Command)
- func SetHelpTemplate(cmd *cobra.Command)
- func SetUsageTemplate(cmd *cobra.Command)
- func Slice2Map(s []string) map[string]bool
- func Str2Bool(s string) (bool, bool)
- func Str2Int(s string) (int, bool)
- func TrimSuffixRepeat(s, suffix string) string
- func Type(v interface{}) string
- func WriteFile(filename, data string, mode int) error
- type PromptError
- type SafeMap
- type VariantName
Constants ¶
View Source
const (
PREFIX_COBRA_COMMAND_ERROR = "Error:\n"
)
View Source
const (
REGEX_IP = `^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})`
)
Variables ¶
View Source
var ( NoArgs = cli.NoArgs RequiresMinArgs = cli.RequiresMinArgs RequiresMaxArgs = cli.RequiresMaxArgs RequiresRangeArgs = cli.RequiresRangeArgs ExactArgs = cli.ExactArgs ShowHelp = command.ShowHelp )
Functions ¶
func CheckMountPoint ¶
func EncryptFile ¶
func GetCurrentHomeDir ¶ added in v0.1.0
func GetCurrentHomeDir() string
func GetCurrentUser ¶
func GetCurrentUser() string
func GetFilePermissions ¶ added in v0.1.0
func IsStringAnyMap ¶
func IsStringAnyMap(v interface{}) bool
func IsValidAddress ¶ added in v0.2.0
func NewCommand ¶
func RandFilename ¶
func RandString ¶
func SetFlagErrorFunc ¶
func SetHelpTemplate ¶
func SetUsageTemplate ¶
func TrimSuffixRepeat ¶ added in v0.1.0
Types ¶
type PromptError ¶
func (PromptError) Error ¶
func (e PromptError) Error() string
type SafeMap ¶
type SafeMap struct { sync.RWMutex Map map[string]interface{} // contains filtered or unexported fields }
func NewSafeMap ¶
func NewSafeMap() *SafeMap
type VariantName ¶ added in v0.1.0
func NewVariantName ¶ added in v0.1.0
func NewVariantName(name string) VariantName
Click to show internal directories.
Click to hide internal directories.