Documentation ¶
Index ¶
- Constants
- func AnyToBytes(data any) (*[]byte, error)
- func AppName() string
- func ClientAddr(ctx *fasthttp.RequestCtx) string
- func ClientIP(ctx *fasthttp.RequestCtx) (string, uint8)
- func CurrentFile() string
- func Error(errCode int, msg string, datas ...any) (res *types.Result)
- func ErrorResponse(ctx *fasthttp.RequestCtx, errCode int, msg string, datas ...any)
- func GetEnvDefault(key, defVal string) string
- func GetFileVariateNameAll(FilePath string) (names []string)
- func GetLocalIP(address ...string) string
- func GetLocalIPs() (ips []string)
- func GetMacAddrs() (macAddrs []string)
- func GetStructFields(v any) (fields []string)
- func IpType(ip string) uint8
- func JsonDecode(str string, v any) error
- func JsonEncode(v any) (string, error)
- func MD5(v string) string
- func MapToStruc[_type interface{ ... }](m map[_type]any, s any) (err error)
- func RandString(n int, bytes ...string) string
- func RangeRand(min, max int) int
- func RpcRequestData() (rpcRequestData rpc.RpcRequestData)
- func RunFuncName() string
- func RunPackageName() string
- func SnakeString(s string) string
- func Success(msg string, datas ...any) (res *types.Result)
- func Time() string
Constants ¶
View Source
const ( RangeLetter0 = "0" RangeLetter1 = "1" )
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶
func ErrorResponse(ctx *fasthttp.RequestCtx, errCode int, msg string, datas ...any)
响应错误数据
func GetFileVariateNameAll ¶ added in v0.1.13
获取文件内的所有变量名
func MapToStruc ¶
map转struc
func RandString ¶ added in v0.3.14
获取指定长度的随机字符串,可自定义字符串
func RpcRequestData ¶ added in v0.1.17
func RpcRequestData() (rpcRequestData rpc.RpcRequestData)
获取rpc上下文请求数据
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.