tool

package
v0.0.0-...-d047b00 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(path string) (string, error)

Abs 将开头的~替换为家目录,再进行绝对值化

func CheckType

func CheckType(currType string, allowTypes []string) bool

func GetDirNameExt

func GetDirNameExt(path string) (string, string, string, error)

GetDirNameExt 输入文件路径,返回文件夹、文件名、文件拓展名(绝对路径)

func GetHomeDir

func GetHomeDir() string

GetHomeDir 返回用户家目录

func GetOutFullName

func GetOutFullName(in string, params model.Params) (string, error)

GetOutFullName ...

func GetOutFullNameFromIn

func GetOutFullNameFromIn(in string, option func(outDir *string, outName *string, outExt *string)) (string, error)

GetOutFullNameFromIn ...

func GetOutFullNameFromOut

func GetOutFullNameFromOut(out string, option func(outDir *string, outName *string, outExt *string)) (string, error)

GetOutFullNameFromOut ...

func GetType

func GetType(path string) (string, error)

GetType 分析输入的路径,返回类型结果

func InitFolder

func InitFolder(fullName string) error

InitFolder 初始化文件夹

func IsDir

func IsDir(path string) bool

IsDir 返回所给路径是否为一个文件夹

func IsExists

func IsExists(path string) bool

IsExists 判断所给路径文件或文件夹是否存在

func SaveFile

func SaveFile(bytes []byte, fileName string) error

func TransformToLogrusLevel

func TransformToLogrusLevel(configLevel string) (uint32, error)

TransformToLogrusLevel ...

func UnZipGithubArchive

func UnZipGithubArchive(zipFile string, dest string) (err error)

UnZipGithubArchive 解压缩 github 归档zip文件到指定目录。 并且忽略 github 归档自动生成的外层文件夹。

Types

This section is empty.

Jump to

Keyboard shortcuts

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