Documentation ¶
Overview ¶
Package utils; From https://github.com/cloudreve/Cloudreve/blob/master/pkg/util/io.go
Package utils; From https://github.com/cloudreve/Cloudreve/blob/master/pkg/util/logger.go
Package utils; From https://github.com/cloudreve/Cloudreve/blob/master/pkg/util/path.go
Index ¶
- Constants
- Variables
- func BuildConcat(str1, str2 string, DBType string) string
- func BuildLogger(level string)
- func BuildRegexp(search []string, prefix, suffix, condition string) string
- func ContainsString(s []string, e string) bool
- func ContainsUint(s []uint, e uint) bool
- func CreatNestedFile(path string) (*os.File, error)
- func DotPathToStandardPath(path string) string
- func Exists(name string) bool
- func Extension(path string) string
- func FileHasMinSuffix(path string) bool
- func FillSlash(path string) string
- func FormSlash(old string) string
- func IsEmpty(name string) (bool, error)
- func RandStringRunes(n int) string
- func RelativePath(name string) string
- func RemoveMinSuffix(path string) string
- func RemoveSlash(path string) string
- func Replace(table map[string]string, s string) string
- func SliceDifference(slice1, slice2 []string) []string
- func SliceIntersect(slice1, slice2 []string) []string
- func SplitPath(path string) []string
- type Logger
- func (ll *Logger) Debug(format string, v ...interface{})
- func (ll *Logger) Error(format string, v ...interface{})
- func (ll *Logger) Info(format string, v ...interface{})
- func (ll *Logger) Panic(format string, v ...interface{})
- func (ll *Logger) Println(prefix string, msg string)
- func (ll *Logger) Warning(format string, v ...interface{})
Constants ¶
View Source
const ( // LevelError 错误 LevelError = iota // LevelWarning 警告 LevelWarning // LevelInformational 提示 LevelInformational // LevelDebug 除错 LevelDebug )
Variables ¶
View Source
var Level = LevelDebug
Functions ¶
func BuildConcat ¶
BuildConcat 根据数据库类型构建字符串连接表达式
func BuildRegexp ¶
BuildRegexp 构建用于SQL查询用的多条件正则
func CreatNestedFile ¶
CreatNestedFile 给定path创建文件,如果目录不存在就递归创建
func DotPathToStandardPath ¶
DotPathToStandardPath 将","分割的路径转换为标准路径
func SliceDifference ¶
SliceDifference 求两个切片差集
Types ¶
Click to show internal directories.
Click to hide internal directories.