Documentation ¶
Index ¶
- Constants
- func BindConfig(filepath string, config interface{}) error
- func Bool(b bool) *bool
- func ClearSession(c *gin.Context)
- func ComparePasswords(hashedPwd string, plainPwd string) bool
- func DeleteSession(c *gin.Context, key string)
- func Float64(f float64) *float64
- func GenInt64ID() int64
- func GetSession(c *gin.Context, key string) interface{}
- func GetTokenFromCtx(ctx context.Context) string
- func GetUserIDFromCtx(ctx context.Context) int64
- func HashAndSalt(pwdStr string) (pwdHash string, err error)
- func Int16(i int16) *int16
- func Int32(i int32) *int32
- func Int64(i int64) *int64
- func MapToSliceInt64(m map[int64]bool) []int64
- func Recovery(ctx context.Context)
- func SetSession(c *gin.Context, fieldMap map[string]interface{})
- func SliceToMapStr(src []string) map[string]bool
- func String(s string) *string
Constants ¶
View Source
const ( CtxKeyLoginUseID = "login_user_id" CtxKeyLoginToken = "login_token" )
Variables ¶
This section is empty.
Functions ¶
func BindConfig ¶
BindConfig 将 yaml 配置文件绑定到 struct 上
func ComparePasswords ¶
ComparePasswords 验证密码
func GenInt64ID ¶
func GenInt64ID() int64
func GetTokenFromCtx ¶
func GetUserIDFromCtx ¶
func MapToSliceInt64 ¶
func SetSession ¶
SetSession 设置session
func SliceToMapStr ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.