Documentation
¶
Index ¶
- func BaseDir(p string) string
- func CompressDir(dir string) error
- func ConvertAnyToInterface(anyValue *any.Any) (interface{}, error)
- func ConvertInterfaceToAny(v interface{}) (*any.Any, error)
- func CopyDir(src, dst, skip string) error
- func CopyDirHasSuffix(src, dst, suffix string) error
- func CopyFile(src, dst string) error
- func Exclude[T comparable](slice []T, element T) []T
- func FileExists(filename string) bool
- func FilesInFolder(dir, filename string) ([]string, error)
- func FolderExists(foldername string) bool
- func GetPage(c *gin.Context, DefaultPageSize int) int
- func GetSha256Hash(str string) string
- func GetStartOfDay() time.Time
- func InSlice[T comparable](element T, Slice []T) bool
- func IntToBool[T constraints.Signed](a T) bool
- func Keys[K comparable, V any](m map[K]V) []K
- func MongoSlice2StringSlice(i interface{}) ([]string, error)
- func MustConvertAnyToInterface(anyValue *any.Any) interface{}
- func MustConvertInterfaceToAny(v interface{}) *any.Any
- func MustMongoSlice2StringSlice(i interface{}) []string
- func ParentBaseDir(p string) string
- func ParentDir(p string) string
- func ParseToken(token, secret string) (*jwt.MapClaims, error)
- func Pop[T any](slice []T) []T
- func PopFront[T any](slice []T) []T
- func Ptr[T any](t T) *T
- func Push[T any](slice []T, element T) []T
- func ReadFile(filename string) (string, error)
- func Reverse[T any](s []T) []T
- func SetDebugMode(debugFunction func())
- func ToInterfaceSlice[T any](slice []T) []interface{}
- func Unique[T comparable](slice []T) []T
- func Zero[T any]() T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressDir ¶
CompressDir compresses the directory into a zip file
func ConvertAnyToInterface ¶
func ConvertInterfaceToAny ¶
func CopyDir ¶
CopyDir copies the directory from the source to the destination skip the file if you don't want to copy
func CopyDirHasSuffix ¶
CopyDirHasSuffix copies the directory from the source to the destination contain is the file if you want to copy, and rename copied filename with dir/index_filename
func Exclude ¶
func Exclude[T comparable](slice []T, element T) []T
func FileExists ¶
FileExists checks if the file exists in the provided path
func FilesInFolder ¶
FilesInFolder returns the filepath contains in the provided folder
func FolderExists ¶
FolderExists checks if the folder exists
func GetSha256Hash ¶
func GetStartOfDay ¶
func InSlice ¶
func InSlice[T comparable](element T, Slice []T) bool
func IntToBool ¶
func IntToBool[T constraints.Signed](a T) bool
func Keys ¶
func Keys[K comparable, V any](m map[K]V) []K
Keys returns a slice of the keys of the map. based with go 1.18 generics
func MongoSlice2StringSlice ¶
func MustMongoSlice2StringSlice ¶
func MustMongoSlice2StringSlice(i interface{}) []string
func ParentBaseDir ¶
ParentBaseDir returns the parent base directory of the provided path
func ParseToken ¶
ParseToken 解析和校验token
func SetDebugMode ¶
func SetDebugMode(debugFunction func())
func ToInterfaceSlice ¶
func ToInterfaceSlice[T any](slice []T) []interface{}
func Unique ¶
func Unique[T comparable](slice []T) []T
Types ¶
This section is empty.