Documentation ¶
Index ¶
- Variables
- func CheckAndCreateDir(path string) error
- func CmdExec(args string) (string, error)
- func CmdRunWithTimeout(cmd *exec.Cmd, timeout time.Duration) (bool, error)
- func CreateFileHash(sourceFile, hashfile string) error
- func CreateHostID() (string, error)
- func CreateVersionByTime() string
- func Deweight(data *[]string)
- func DirIsEmpty(dir string) bool
- func DiskUsage(path string) (tatol, free uint64)
- func Exec(ctx context.Context, f func() error, wait time.Duration) error
- func FileExists(filename string) (bool, error)
- func FileExistsWithSuffix(pathDir, suffix string) bool
- func GetDirList(dirpath string, level int) ([]string, error)
- func GetDirNameList(dirpath string, level int) ([]string, error)
- func GetDirSize(path string) float64
- func GetDirSizeByCmd(path string) float64
- func GetFileList(dirpath string, level int) ([]string, error)
- func GetFileSize(path string) int64
- func GetIDFromKey(key string) string
- func GetParentDirectory(dirctory string) string
- func IntermittentExec(ctx context.Context, f func(), t time.Duration)
- func IsHaveFile(path string) bool
- func LocalIP() (net.IP, error)
- func MergeDir(fromdir, todir string) error
- func NewUUID() string
- func OpenOrCreateFile(filename string) (*os.File, error)
- func ProfilerSetup(r *chi.Mux)
- func ReadHostID(filePath string) (string, error)
- func RemoveSpaces(sources []string) (re []string)
- func Rename(old, new string) error
- func SearchFile(pathDir, name string, level int) bool
- func SearchFileBody(filename, searchStr string) bool
- func SendNoBlocking(m []byte, ch chan []byte)
- func Translation(english string) string
- func Unzip(archive, target string) error
- func Zip(source, target string) error
- type SSHClient
Constants ¶
This section is empty.
Variables ¶
var StatefulServiceType = "StatefulServiceType"
StatefulServiceType 有状态应用
var StatelessServiceType = "StatelessServiceType"
StatelessServiceType 无状态应用
Functions ¶
func CheckAndCreateDir ¶
CheckAndCreateDir check and create dir
func CmdRunWithTimeout ¶
CmdRunWithTimeout exec cmd with timeout
func CreateFileHash ¶
CreateFileHash compute sourcefile hash and write hashfile
func CreateVersionByTime ¶
func CreateVersionByTime() string
CreateVersionByTime create version number
func FileExistsWithSuffix ¶
FileExistsWithSuffix 指定目录是否含有指定后缀的文件
func GetDirList ¶
GetDirList get all lower level dir
func GetDirNameList ¶
GetDirNameList get all lower level dir
func GetDirSizeByCmd ¶
GetDirSizeByCmd get dir sizes by du command return kb
func GetParentDirectory ¶
GetParentDirectory GetParentDirectory
func IntermittentExec ¶
IntermittentExec 间歇性执行
func OpenOrCreateFile ¶
OpenOrCreateFile open or create file
func ReadHostID ¶
ReadHostID 读取当前机器ID ID是节点的唯一标识,acp_node将把ID与机器信息的绑定关系维护于etcd中
func SearchFile ¶
SearchFile 搜索指定目录是否有指定文件,指定搜索目录层数,-1为全目录搜索
func SearchFileBody ¶
SearchFileBody 搜索文件中是否含有指定字符串
func Translation ¶
Translation Translation English to Chinese