pkg

package
v0.0.0-...-b705d59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2019 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 Bytes2Data(rb []byte, object interface{}, field string) error

func Data2Bytes

func Data2Bytes(object interface{}, field string) ([]byte, error)

func GenerateJwt

func GenerateJwt(secret string, data map[string]interface{}, expired time.Time) (encoded string, err error)

func GenerateRandomKey16

func GenerateRandomKey16() string

生成6为随机字符串

func GenerateRandomKey20

func GenerateRandomKey20() string

生成20位随机字符串

func InitLogger

func InitLogger()

func InitValidate

func InitValidate()

func SetPassword

func SetPassword(password string, salt string) (verify string, err error)

func StringToInt

func StringToInt(s string) int

func StringToUint

func StringToUint(s string) uint

func VerifyJwt

func VerifyJwt(secret string, encoded string) (claims *jwt.Claims, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL