utils

package
v0.0.0-...-80df095 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MysqlDB    *gorm.DB
	MysqlDBErr error
)
View Source
var (
	RedisDB    *redis.Client
	RedisDBCtx context.Context
)

Functions

func AcquireLockWithTimeout

func AcquireLockWithTimeout(lockName string) bool

func GetLockTTL

func GetLockTTL(lockName string) time.Duration

func ParseIdentityCard

func ParseIdentityCard(identityCard string) (bool, time.Time)

func ReleaseLock

func ReleaseLock(lockName string) bool

func StatusOKResponse

func StatusOKResponse(response Response, c *gin.Context)

Types

type Response

type Response struct {
	Code int         `json:"code"` // 业务返回码
	Data interface{} `json:"data"` //业务返回数据
	Msg  string      `json:"msg"`  // 业务返回描述
}

Jump to

Keyboard shortcuts

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