Documentation ¶
Index ¶
- Variables
- func ClientIP(r *http.Request) string
- func CopyWithCtx(ctx context.Context, out io.Writer, in io.Reader, size int64, ...) error
- func CreateNestedFile(path string) (*os.File, error)
- func CreateTempFile(r io.ReadCloser) (*os.File, error)
- func EncodePath(path string, all ...bool) string
- func Exists(name string) bool
- func Ext(path string) string
- func GetActualVirtualPath(virtualPath string) string
- func GetFileType(filename string) int
- func GetMD5Encode(data string) string
- func GetSHA1Encode(data string) string
- func IsBalance(str string) bool
- func IsCanceled(ctx context.Context) bool
- func MergeMap(mObj ...map[string]interface{}) map[string]interface{}
- func PathEqual(path1, path2 string) bool
- func SliceContains[T comparable](arr []T, v T) bool
- func SliceConvert[S any, D any](srcS []S, convert func(src S) (D, error)) ([]D, error)
- func SliceEqual[T comparable](a, b []T) bool
- func StandardizePath(path string) string
- func WriteJsonToFile(dst string, data interface{}) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var Json = json.ConfigCompatibleWithStandardLibrary
View Source
var Log = log.New()
Functions ¶
func CopyWithCtx ¶
func CopyWithCtx(ctx context.Context, out io.Writer, in io.Reader, size int64, progress func(percentage int)) error
CopyWithCtx slightly modified function signature: - context has been added in order to propagate cancelation - I do not return the number of bytes written, has it is not useful in my use case
func CreateNestedFile ¶
CreateNestedFile create nested file
func CreateTempFile ¶
func CreateTempFile(r io.ReadCloser) (*os.File, error)
CreateTempFile create temp file from io.ReadCloser, and seek to 0
func EncodePath ¶
func GetActualVirtualPath ¶
GetActualVirtualPath remove balance suffix
func GetMD5Encode ¶
func GetSHA1Encode ¶
func IsCanceled ¶
func SliceContains ¶
func SliceContains[T comparable](arr []T, v T) bool
SliceContains check if slice contains element
func SliceConvert ¶
SliceConvert convert slice to another type slice
func SliceEqual ¶
func SliceEqual[T comparable](a, b []T) bool
SliceEqual check if two slices are equal
func StandardizePath ¶
StandardizePath convert path like '/' '/root' '/a/b'
func WriteJsonToFile ¶
WriteJsonToFile write struct to json file
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.