util

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPage     = 1
	DefaultPageSize = 10
)
View Source
const (
	NotFindTip       = "未查询到相关信息"
	SearchSuccessTip = "查询成功"
	SuccessTip       = "success"
	ActionSuccessTip = "操作成功"
)
View Source
const (
	RequestHeadMethod   = "head"
	RequestOptionMethod = "options"
)
View Source
const (
	SuccessCode    = 0
	FailCode       = -1
	DefaultVersion = 1.0
)

Variables

This section is empty.

Functions

func GetPath added in v0.0.4

func GetPath() string

func Hmac added in v0.0.20

func Hmac(key, data string) string

key随意设置 data 要加密数据

func HmacSha256 added in v0.0.20

func HmacSha256(key, data string) string

func Md5

func Md5(data []byte) string

func NowDateToString added in v0.0.21

func NowDateToString() string

func NowTimeToString

func NowTimeToString() string

NowTimeToString *******现在日期格式化 yyyy-MM-dd HH:mm:ss*******//

func RandInt added in v0.0.14

func RandInt(min, max int) int

func RandomString added in v0.0.14

func RandomString(length int) string

func ReflectValueByType added in v0.0.4

func ReflectValueByType(value string, valueType string) interface{}

func RemoveRepetitionIntSlice added in v0.0.8

func RemoveRepetitionIntSlice(targetList []int) (result []int)

func RemoveRepetitionStringSlice added in v0.0.8

func RemoveRepetitionStringSlice(targetList []string) (result []string)

func RemoveSliceEmpty

func RemoveSliceEmpty(arg []string) []string

RemoveSliceEmpty *******删除slice里面的空格和去除字符的前后的空格*******//

func ReturnResponse

func ReturnResponse(httpCode, errCode int, message interface{}, data interface{}, c *gin.Context, version ...float64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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