util

package
v0.0.0-...-79cb864 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionKey    = "uid"
	TokenCache    = "tokenCache"
	TokenCacheKey = "token"
)

auth module

View Source
const (
	DateTimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken() string

GenerateToken create new json web token

func GenerateUserLoginToken

func GenerateUserLoginToken(userId int) (string, error)

GenerateUserLoginToken generate user login token by userId, current timestamp and uuid

func Md5Encrypt

func Md5Encrypt(plaintext string) string

Md5Encrypt encrypt plaintext using "md5" hash algorithm

func ParseRequestParams

func ParseRequestParams(requestBody []byte, params interface{}) errors.AuthError

ParseRequestParams handle and parse request params

func Sha256Encrypt

func Sha256Encrypt(plaintext string) string

Sha256Encrypt

func VerifyToken

func VerifyToken(token string) bool

VerifyToken check token if valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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