Documentation
¶
Index ¶
- func CreateFile(inputPath string) (*os.File, error)
- func CreatePath(inputPath string) error
- func DiskFreeCheck(path string) uint64
- func ErgodicDir(inputPath string) (dirList []string, err error)
- func ErgodicExtFile(inputPath string, ext string) (fileList []string, err error)
- func ErgodicFile(inputPath string) (fileList []string, err error)
- func Exist(inputPath string) bool
- func GenDayTimeStamp() string
- func GenMicrosecondTimeStamp() string
- func GenMillisecondTimeStamp() string
- func GenMinuteTimeStamp() string
- func GenSecondTimeStamp() string
- func GenUUID() string
- func GenVerificationCode(size int) string
- func GetFreePort() string
- func GetHomePath() string
- func ImageRaw2Png(raw []byte, width, height int) ([]byte, error)
- func MD5(inputPath string) (string, error)
- func MD5FromByte(data []byte) string
- func MD5FromString(data string) string
- func MustMD5(inputPath string) string
- func MustSliceStringToInt32(in []string) []int32
- func Ok() bool
- func OpenFile(path string, create, forWrite bool) (file *os.File, err error)
- func ParseAllTime(stamp string) (time.Time, bool)
- func ParseDayTime(stamp string) (time.Time, bool)
- func ParseHourTime(stamp string) (time.Time, bool)
- func ParseMicrosecondTime(stamp string) (time.Time, bool)
- func ParseMillisecondTime(stamp string) (time.Time, bool)
- func ParseMinuteTime(stamp string) (time.Time, bool)
- func ParseMonthTime(stamp string) (time.Time, bool)
- func ParseSecondTime(stamp string) (time.Time, bool)
- func ParseYearTime(stamp string) (time.Time, bool)
- func Pgm2Png(pgmRaw []byte) ([]byte, error)
- func RandomString() string
- func Read(inputPath string) (string, error)
- func ReadByte(inputPath string) ([]byte, error)
- func ReadToB64(path string) (string, error)
- func RecursiveErgodicExtFile(inputPath string, ext string) (fileListDir []string, err error)
- func RecursiveErgodicFile(inputPath string) (fileListDir []string, err error)
- func Remove(path string) error
- func ReportK8sProbeError(msg string)
- func RunK8sHttpProbe(path string, port string)
- func Sha256(raw []byte) string
- func Sha256FromFile(path string) string
- func Sha512(raw string) string
- func SignalCtx(ctx context.Context) context.Context
- func Size(inputPath string) int64
- func Sleep(seconds float32)
- func Startpprof(port string)
- func TimeCost() func()
- func ToMinuteTimeStamp(t time.Time) string
- func ToString(input ...interface{}) string
- func Unzip(data []byte, basePath string) error
- func Wait()
- func Write(inputPath string, data []byte) error
- func WriteFromB64(inputPath, data string) error
- func Zip(write io.ReadWriter, files []ZipFile)
- type PGM
- type ZipFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
CreateFile 创建文件 inputPath 指定路径 return error:
func CreatePath ¶
CreatePath 创建目录 inputPath 指定路径 return true:创建目录成功,false::创建目录失败
func ErgodicDir ¶
ErgodicDir 遍历指定目录中所有的文件夹 inputPath 需要遍历的目录 return dirList 该目录下所有的文件夹, err 错误
func ErgodicExtFile ¶
ErgodicExtFile 遍历指定目录中指定后缀的文件 inputPath 需要遍历的目录 ext 后缀名,例如“.txt" return fileList 符合要求的文件列表, err 错误
func ErgodicFile ¶
ErgodicFile 遍历指定目录中的文件 inputPath 需要遍历的目录 return fileList 符合要求的文件列表, err 错误
func Exist ¶
Exist 判断目录或文件是否存在 inputPath 指定路径 返回true:文件或目录存在 返回false:文件或目录不存在
func GenMicrosecondTimeStamp ¶
func GenMicrosecondTimeStamp() string
GenMicrosecondTimeStamp 生成当前时间戳,精确到微秒 格式为2006-01-02 15:04:05.000000
func GenMillisecondTimeStamp ¶
func GenMillisecondTimeStamp() string
GenMillisecondTimeStamp 生成当前时间戳,精确到毫秒 格式为2006-01-02 15:04:05.000
func GenMinuteTimeStamp ¶
func GenMinuteTimeStamp() string
GenMinuteTimeStamp 生成当前时间戳,精确到分 格式为2006-01-02 15:04
func GenSecondTimeStamp ¶
func GenSecondTimeStamp() string
GenSecondTimeStamp 生成当前时间戳,精确到秒 格式为2006-01-02 15:04:05
func OpenFile ¶
OpenFile 打开文件 inputPath 指定路径 forWrite 是否可写 返回 file 文件指针,err,错误
func Read ¶
Read 读取指定文件的内容 inputPath 指定路径 @return 数据内容和错误码
func ReadByte ¶
ReadByte 读取指定文件的内容 inputPath 指定路径 @return 数据内容和错误码
func ReadToB64 ¶
ReadToB64 读取文件,输出为base64 inputPath 指定路径 @return base64格式的数据内容
func RecursiveErgodicExtFile ¶
RecursiveErgodicExtFile 遍历指定目录中的文件 inputPath 需要遍历的目录 return fileListDir 符合要求的文件列表(包含目录), err 错误
func RecursiveErgodicFile ¶
RecursiveErgodicFile 遍历指定目录中的文件 inputPath 需要遍历的目录 return fileListDir 符合要求的文件列表(包含目录), err 错误
func TimeCost ¶
func TimeCost() func()
func Write ¶
Write 向指定文件写入内容 inputPath 指定路径 data 数据内容 @return 写入结果错误码
func WriteFromB64 ¶
WriteFromB64 向指定文件写入内容 inputPath 指定路径 data 数据内容 @return 写入结果错误码
func Zip ¶
func Zip(write io.ReadWriter, files []ZipFile)