Documentation ¶
Overview ¶
* @Date: 2022-04-30 10:34:56 * @LastEditTime: 2022-04-30 19:47:21 * @FilePath: \go-frame\pkgs\common\consts.go
* @Date: 2022-04-30 10:34:56 * @LastEditTime: 2022-05-01 22:29:19 * @FilePath: \go-frame\pkgs\common\utils.go
Index ¶
- Constants
- Variables
- func BytesToString(b []byte) string
- func GenID() string
- func GenNanoID() (string, error)
- func GenZapNanoId() zapcore.Field
- func InjectRedis(redisC redis.UniversalClient)
- func Lock(key string, options ...redsync.Option) (func() error, error)
- func MustValidate(a any)
- func ObjectArrayMarshaler(f zapcore.ArrayMarshalerFunc) zapcore.ArrayMarshalerFunc
- func ObjectMarshaler(f func(zapcore.ObjectEncoder)) zapcore.ObjectMarshalerFunc
- func Panic(err error)
- func StringToBytes(s string) []byte
- func TryGenNanoIDFromAlphaNumber(size, tryCount int, isValid func(id string) (bool, error)) (string, error)
- func Wrap(ctx *gin.Context) *ginContextWrapper
- func ZapIntArray(key string, data []int) zapcore.Field
- func ZapStringArray(key string, data []string) zapcore.Field
Constants ¶
View Source
const ( DevMode = "dev" TestMode = "test" )
View Source
const ( False = iota True )
View Source
const (
DefaultDb = "default"
)
默认的数据库连接名字
View Source
const (
HttpCallTimeOut = time.Second * 5
)
http调用超时
View Source
const (
RedisTimeout = time.Second * 5
)
Variables ¶
View Source
var (
Dev bool
)
Functions ¶
func GenZapNanoId ¶
func InjectRedis ¶
func InjectRedis(redisC redis.UniversalClient)
func ObjectArrayMarshaler ¶
func ObjectArrayMarshaler(f zapcore.ArrayMarshalerFunc) zapcore.ArrayMarshalerFunc
func ObjectMarshaler ¶
func ObjectMarshaler(f func(zapcore.ObjectEncoder)) zapcore.ObjectMarshalerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.