util

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelTrace = "trace"
	LogLevelDebug = "debug"
	LogLevelInfo  = "info"
	LogLevelWarn  = "warn"
	LogLevelError = "error"
	LogLevelFatal = "fatal"
	LogLevelPanic = "panic"
)
View Source
const AppDirName = ".cf"
View Source
const (
	CFHomeEnvVar = "CF_HOME"
)

Variables

This section is empty.

Functions

func AlertUpdateInfo

func AlertUpdateInfo()

func Atoi

func Atoi(s string) int

func CheckVersion

func CheckVersion(version string) (bool, string)

func CreateFolder added in v0.3.5

func CreateFolder(folder string)

判断文件夹是否存在,如果不存在则新建该文件夹

func GenerateRandomPasswords added in v0.3.1

func GenerateRandomPasswords() string

func GetCFHomeDir

func GetCFHomeDir() (string, error)

func GetCurrentVersion

func GetCurrentVersion() string

func GetUpdateTime

func GetUpdateTime() string

func HandleErr

func HandleErr(e error)

func HandleErrNoExit added in v0.2.0

func HandleErrNoExit(e error)

func Init

func Init(level string)

func IsFlushCache added in v0.2.2

func IsFlushCache(oldTimeStamp int64) bool

func ReadTimeStamp

func ReadTimeStamp(timeStampFile string) int64

func RemoveDuplicatesAndEmpty added in v0.3.1

func RemoveDuplicatesAndEmpty(a []string) (ret []string)

去除重复字符串和空格

func ReturnCacheDict

func ReturnCacheDict() string

func ReturnECSTimeStampFile added in v0.2.2

func ReturnECSTimeStampFile() string

func ReturnOSSTimeStampFile added in v0.2.2

func ReturnOSSTimeStampFile() string

func ReturnRDSTimeStampFile added in v0.2.2

func ReturnRDSTimeStampFile() string

func ReturnVersionTimeStampFile added in v0.2.2

func ReturnVersionTimeStampFile() string

func TimeDifference added in v0.2.2

func TimeDifference(oldTimeStamp int64)

func WriteTimeStamp

func WriteTimeStamp(file string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL