Documentation
¶
Index ¶
- Constants
- func Abs(path string) (string, error)
- func CleanOldFiles(files []FileInfo, count int) (int, error)
- func CompareVersionFunc(a, b string, f func(a, b string) bool) bool
- func ErrPrintf(format string, a ...interface{})
- func ExecCommand(ctx context.Context, args []string) ([]byte, error)
- func Executable() string
- func ExternalIP() (string, error)
- func GetDirSize(path string) (int64, error)
- func Getwd() string
- func LocalIP() string
- func PortUsed(mode string, port int) bool
- func RemoveEmptyDirs(rootDir string) error
- func WarnPrintf(format string, a ...interface{})
- type FileBackup
- type FileInfo
- type Info
Constants ¶
View Source
const ( Reset = "\033[0m" // 重置颜色 Red = "\033[31m" // 红色 Green = "\033[32m" // 绿色 Yellow = "\033[33m" // 黄色 Blue = "\033[34m" // 蓝色 )
Variables ¶
This section is empty.
Functions ¶
func CompareVersionFunc ¶
CompareVersionFunc 比较 ip 或 版本号是否一致
func ErrPrintf ¶ added in v1.0.12
func ErrPrintf(format string, a ...interface{})
ErrPrintf error output
func WarnPrintf ¶ added in v1.0.12
func WarnPrintf(format string, a ...interface{})
WarnPrintf warn output
Types ¶
type FileBackup ¶
type FileBackup struct {
// contains filtered or unexported fields
}
func NewFileBackup ¶
func NewFileBackup(file string) *FileBackup
func (*FileBackup) Close ¶
func (f *FileBackup) Close()
func (*FileBackup) Write ¶
func (f *FileBackup) Write(data []byte)
type Info ¶
type Info struct { IP string `json:"ip"` Pro string `json:"pro"` // 省;安徽省 ProCode string `json:"proCode"` // 省区域代码;340000 City string `json:"city"` // 城市;合肥市 CityCode string `json:"cityCode"` // 城市代码;340100 Region string `json:"region"` // 区域;蜀山区 RegionCode string `json:"regionCode"` // 区域代码;340104 Addr string `json:"addr"` // 完整地址;安徽省合肥市蜀山区 电 RegionNames string `json:"regionNames"` Err string `json:"err"` }
Click to show internal directories.
Click to hide internal directories.