helper

package
v0.0.0-...-d4a3341 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendPath

func AppendPath(rootPath string, paths ...string) string

appendPath 拼接路径

func DirExist

func DirExist(dir string) bool

DirExist check dir

func FileExist

func FileExist(filename string) bool

FileExist check file

func GetImageFolderPath

func GetImageFolderPath() string

GetImageFolderPath 保存图片的文件夹路径

func GetUploadFolderPath

func GetUploadFolderPath() string

GetUploadFolderPath 保存上传文件的文件夹路径

func HomeDir

func HomeDir(path string) (string, error)

HomeDir join path with app home dir

func PathExists

func PathExists(path string) bool

pathExists 判断路径是否存在

func RandInt

func RandInt(min int, max int) int

RandInt rand int between [min, max)

func RandMax

func RandMax(max int) int

RandMax rand int between [0, max)

func RandString

func RandString(length int) string

RandString rand string

func RandStringWithCharset

func RandStringWithCharset(length int, charset string) string

RandStringWithCharset rand string with charset

func ReadJSON

func ReadJSON(v interface{}, filename string) error

ReadJSON read json to data

func SliceToString

func SliceToString(sl []string) string

func SliceUnit64ToString

func SliceUnit64ToString(sl []uint64) string

func StringToUnit64Arr

func StringToUnit64Arr(s string) []uint64

func WriteJSON

func WriteJSON(v interface{}, filename string, force bool) error

WriteJSON write data to json

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL