Documentation ¶
Index ¶
- func CheckProcessExist(pid int) bool
- func CopyFile(source, destination string) error
- func CopyFolder(source, destination string) error
- func CreateFileTemlate(folderNeedCreate bool, folderPath string, file string, tmp string, ...) error
- func DownloadFile(filepath string, url string) error
- func Exists(path string) bool
- func GetExecDirectory() string
- func IsHiddenDirectory(path string) bool
- func KillPid(pid int) error
- func PrettyPrint(arr [][]string)
- func RebuildApp() error
- func ResolveRateLimitErrorByAuth(err error) (*github.Client, error)
- func SafeGo(ctx context.Context, handler func())
- func SafeGoAndWait(ctx context.Context, handlers ...func() error) error
- func SubDir(folder string) ([]string, error)
- func ToTitleCamel(word string) string
- func Unzip(src string, dest string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckProcessExist ¶
func CopyFolder ¶ added in v1.0.0
CopyFolder 将一个目录复制到另外一个目录中
func CreateFileTemlate ¶
func CreateFileTemlate(folderNeedCreate bool, folderPath string, file string, tmp string, data interface{}) error
folderNeedCreate 表明路径是否需要创建 folderPath/file 确定了目标文件的路径 tmp 为模板字符串, data为数据
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
func RebuildApp ¶ added in v1.0.0
func RebuildApp() error
func ResolveRateLimitErrorByAuth ¶ added in v1.0.6
func SafeGo ¶ added in v1.0.6
SafeGo 进行安全的goroutine调用 SafeGo 启动的goroutine不会因为函数返回error或者异常导致请求异常,相关的 panic 信息会通过日志服务打印
func SafeGoAndWait ¶ added in v1.0.6
SafeGoAndWait 进行并发安全并行调用 第一个参数是context接口,如果还实现了Container接口,且绑定了日志服务,则使用日志服务 第二个参数是匿名函数handlers数组, 进行最终的业务逻辑 返回handlers中任何一个错误(如果handlers中有业务逻辑返回错误)
func ToTitleCamel ¶ added in v1.0.6
ToTitleCamel 将下划线分割的字符串转换为驼峰字符串 class_id => ClassId
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.