Documentation
¶
Index ¶
- func Capitalize(s string) string
- func DefaultConfigPath(filename string) string
- func DefaultConfigPathWithName(name string, filename string) string
- func DefaultDBPath(dsn string) string
- func DefaultDBPathWithName(name string, dsn string) string
- func DefaultDownloadPath(filename string) string
- func DefaultDownloadPathWithName(name string, filename string) string
- func DefaultLogPath(app string) string
- func DefaultLogPathWithName(name string, filename string) string
- func ElapsedTimeSince(beginTime time.Time) string
- func Exists(path string) bool
- func Filter[T any](input []T, fn func(T) bool) []T
- func Find[T any](input []T, fn func(T) bool) (T, bool)
- func JSONString(data interface{}) string
- func Map[T any, R any](input []T, fn func(T) R) []R
- func PrettyJSONString(data interface{}) string
- func PrettyStruct(data interface{}) (string, error)
- func Reduce[T any, R any](input []T, initial R, fn func(R, T) R) R
- func SnakeToCamel(s string) string
- func TimeCost() func()
- func ToSnakeCase(str string) string
- func WithTempDir(do func(tempDir string) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultDBPath ¶
func DefaultDBPathWithName ¶
func DefaultDownloadPath ¶
func DefaultLogPath ¶
DefaultLogPath 外部调用(推荐使用这个)自动判断操作系统并返回默认日志路径
func DefaultLogPathWithName ¶
DefaultLogPathWithName 返回日志完整路径:<log_dir>/<filename>,若 filename 为空则自动生成。
func ElapsedTimeSince ¶
func JSONString ¶
func JSONString(data interface{}) string
func PrettyJSONString ¶
func PrettyJSONString(data interface{}) string
func PrettyStruct ¶
func SnakeToCamel ¶ added in v1.0.1
func ToSnakeCase ¶ added in v1.0.1
ToSnakeCase converts camelCase to snake_case
func WithTempDir ¶
WithTempDir 创建临时目录,执行用户提供的操作函数,结束后自动删除该目录。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.