Documentation ¶
Overview ¶
Package pcsutil 工具包
Index ¶
- Variables
- func ChWorkDir()
- func ContainsString(ss []string, s string) bool
- func ConvertToUnixPathSeparator(p string) string
- func CryptoMethodSupport(method string) bool
- func DecompressGZIP(r io.Reader) ([]byte, error)
- func DecryptFile(method string, key []byte, filePath string, isGzip bool) (decryptedFilePath string, err error)
- func EncryptFile(method string, key []byte, filePath string, isGzip bool) (encryptedFilePath string, err error)
- func Executable() string
- func ExecutablePath() string
- func ExecutablePathJoin(subPath string) string
- func FlagProvided(names ...string) bool
- func GetURLCookieString(urlString string, jar *cookiejar.Jar) string
- func IsIPhoneOS() bool
- func ListAddresses() (addresses []string)
- func PrintErrAndExit(annotate string, err error)
- func PrintErrIfExist(err error)
- func SetLogPrefix()
- func Trigger(f func())
- func TriggerOnSync(f func())
- func WalkDir(dirPth, suffix string) (files []string, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HTTPSRE https regexp HTTPSRE = regexp.MustCompile("^https") // ChinaPhoneRE https regexp ChinaPhoneRE = regexp.MustCompile(`^(\+86)?1[3-9][0-9]\d{8}$`) )
View Source
var ( // ErrorColor 设置输出错误的颜色 ErrorColor = color.New(color.FgRed).SprintFunc() )
View Source
var ( // PipeInput 命令中是否为管道输入 PipeInput bool )
Functions ¶
func ConvertToUnixPathSeparator ¶
ConvertToUnixPathSeparator 将 windows 目录分隔符转换为 Unix 的
func CryptoMethodSupport ¶
CryptoMethodSupport 检测是否支持加密解密方法
func DecompressGZIP ¶
DecompressGZIP 对 io.Reader 数据, 进行 gzip 解压
func DecryptFile ¶
func DecryptFile(method string, key []byte, filePath string, isGzip bool) (decryptedFilePath string, err error)
DecryptFile 加密本地文件
func EncryptFile ¶
func EncryptFile(method string, key []byte, filePath string, isGzip bool) (encryptedFilePath string, err error)
EncryptFile 加密本地文件
func ExecutablePathJoin ¶
ExecutablePathJoin 返回程序所在目录的子目录
func FlagProvided ¶
FlagProvided 检测命令行是否提供名为 name 的 flag, 支持多个name(names)
func GetURLCookieString ¶
GetURLCookieString 返回cookie字串
func PrintErrAndExit ¶
PrintErrAndExit 简易错误处理, 如果 err 存在, 向屏幕输出 err 并退出, annotate 是加在 err 之前的注释信息。
func PrintErrIfExist ¶
func PrintErrIfExist(err error)
PrintErrIfExist 简易错误处理, 如果 err 存在, 就只向屏幕输出 err 。
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package checksum 校验本地文件包
|
Package checksum 校验本地文件包 |
Package converter 格式, 类型转换包
|
Package converter 格式, 类型转换包 |
Package getip 获取 ip 信息包
|
Package getip 获取 ip 信息包 |
Package pcstime 时间工具包
|
Package pcstime 时间工具包 |
Package waitgroup sync.WaitGroup extension
|
Package waitgroup sync.WaitGroup extension |
Click to show internal directories.
Click to hide internal directories.