Documentation ¶
Index ¶
- Constants
- Variables
- func Authorization(fn server.HandlerFunc) server.HandlerFunc
- func Bytes2Data(rb []byte, object interface{}, field string) error
- func Data2Bytes(object interface{}, field string) ([]byte, error)
- func GenerateJwt(secret string, data map[string]interface{}, expired time.Time) (encoded string, err error)
- func GenerateRandomKey16() string
- func GenerateRandomKey20() string
- func InitLogger()
- func InitValidate()
- func SetPassword(password string, salt string) (verify string, err error)
- func StringToInt(s string) int
- func StringToUint(s string) uint
- func VerifyJwt(secret string, encoded string) (claims *jwt.Claims, err error)
Constants ¶
View Source
const ( TenantScope = "tenant" //租户后台 BackendScope = "backend" //应用后台 FrontendScope = "frontend" //应用前台 )
Variables ¶
View Source
var ( Uni *ut.UniversalTranslator Validate *validator.Validate )
Functions ¶
func Authorization ¶
func Authorization(fn server.HandlerFunc) server.HandlerFunc
logWrapper is a handler wrapper
func Bytes2Data ¶
func Data2Bytes ¶
func GenerateJwt ¶
func InitLogger ¶
func InitLogger()
func InitValidate ¶
func InitValidate()
func StringToInt ¶
func StringToUint ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.