tool

package
v0.0.0-...-3b8996f Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS int = 0 // 操作成功
	FAILED  int = 1 // 操作失败
)

Variables

View Source
var (
	LogAccess *logrus.Logger
	LogError  *logrus.Logger
)

Functions

func Crc32

func Crc32(str string) uint32

func CurrentDate

func CurrentDate() string

func Fail

func Fail(ctx *gin.Context, msg string)

Fail 请求失败的时候, 使用该方法返回信息

func GenerateUniqId

func GenerateUniqId(params string) string

GenerateUniqId 生成唯一id

func GetType

func GetType(data interface{}) string

GetType 获取变量类型

func InitLog

func InitLog(c config.Conf) error

func Int64ToString

func Int64ToString(i64 int64) string

Int64ToString int64转string

func SetLogLevel

func SetLogLevel(log *logrus.Logger, levelString string) error

func SetLogOut

func SetLogOut(log *logrus.Logger, outString string) error

func StringToInt64

func StringToInt64(s string) int64

StringToInt64 string转int64

func Success

func Success(ctx *gin.Context, msg string, data interface{})

Success 请求成功的时候 使用该方法返回信息

func TimestampToDate

func TimestampToDate(timestamp int64) string

TimestampToDate 时间戳转化为日期

Types

This section is empty.

Jump to

Keyboard shortcuts

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