Documentation ¶
Index ¶
- Variables
- 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 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 HttpClient ¶
HttpClient 发起一个http请求
func SelectAllToStruct ¶
SelectAllToStruct 查询多条转换为结构体组
func SelectOneToStruct ¶
SelectOneToStruct 查询单条转换为结构体
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.