middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogHttp *zap.Logger
	//LogCron *zap.Logger
	HttpLogEnable bool
)
View Source
var LocalMem map[string]m.Session

var RedisClient *redis.Client

Functions

func DelSession

func DelSession(sId string)

func GetOperateUser

func GetOperateUser(c *gin.Context) string

func GetSessionData

func GetSessionData(sId string) m.Session

func InitLocalSession

func InitLocalSession()

func InitMonitorLog

func InitMonitorLog()

func IsActive

func IsActive(sId string) bool

func IsIllegalName

func IsIllegalName(str string) bool

func LogError

func LogError(s string, e error)

func LogInfo

func LogInfo(s string)

func Return

func Return(c *gin.Context, j RespJson)

func ReturnData

func ReturnData(c *gin.Context, data interface{})

func ReturnError

func ReturnError(c *gin.Context, msg string, err error)

func ReturnSuccess

func ReturnSuccess(c *gin.Context, msg string)

func ReturnValidateFail

func ReturnValidateFail(c *gin.Context, msg string)

func SaveSession

func SaveSession(session m.Session) (isOk bool, sId string)

func ValidateGet

func ValidateGet(c *gin.Context)

func ValidatePost

func ValidatePost(c *gin.Context, obj interface{}, ex ...string) bool

Types

type RespJson

type RespJson struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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