Documentation
¶
Index ¶
- Variables
- func Base642File(base64Str, filePath, filename string) (err error)
- func ErrorIsSystem(err error) bool
- func GetBase64Data(base64Str string) (string, error)
- func GetErrorCode(err error) gcode.Code
- func GetFileExtension(base64Str string) (string, error)
- func HttpClient(method, url string, data any, opt ...any) (gJson *gjson.Json, err error)
- func IF(condition bool, a, b any) any
- func InArr[T any](a T, arr []T) bool
- func Maintain(handler func())
- func RedisScanData(ctx context.Context, key string, ...) (err error)
- func SafeExit()
- func SelectAllToStruct[T any](all gdb.Result) []T
- func SelectOneToStruct[T any](one gdb.Record) *T
- func Sha256(text string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var HttpNotJsonHandler = func(str string) string { if !gjson.Valid(str) { return gjson.MustEncodeString(g.Map{"resp": str}) } return str }
HttpNotJsonHandler 处理 http 返回的不是个 json
Functions ¶
func Base642File ¶ added in v0.5.20
Base642File Base64 转文件
func GetBase64Data ¶ added in v0.5.20
GetBase64Data 获取 Base64 数据
func GetErrorCode ¶ added in v0.5.9
GetErrorCode 获取 error 的 g code
func GetFileExtension ¶ added in v0.5.20
GetFileExtension 获取文件后缀
func HttpClient ¶
HttpClient 发起一个http请求
func RedisScanData ¶ added in v0.5.18
func RedisScanData(ctx context.Context, key string, fn func(ctx context.Context, conn gredis.Conn, keys []string) (err error), count int) (err error)
RedisScanData 扫描 redis 数据 (替代 keys 操作)
func SelectAllToStruct ¶
SelectAllToStruct 查询多条转换为结构体组
func SelectOneToStruct ¶
SelectOneToStruct 查询单条转换为结构体
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.