comfunc

package
v0.0.0-...-0b50f6a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPassword string = "123456"

DefaultPassword const Params

View Source
const TokenInvaild string = "Token invaild"

TokenInvaild Const Params

Variables

This section is empty.

Functions

func DecryptToken

func DecryptToken(token string, key string) (srcStr string)

DecryptToken Token

func EncryptToken

func EncryptToken(srcStr string, timeTs int64, key string) (token string)

EncryptToken Init Token

func FlorPageInt

func FlorPageInt(pageSize int, total int) (res int)

FlorPageInt 分页整除判断

func FormatShortTs

func FormatShortTs(ts int64) (res string)

FormatShortTs 格式化时间戳为字符串

func FormatSubTimeStr

func FormatSubTimeStr(duration int64) (res string)

FormatSubTimeStr 格式化时间间隔

func FormatTs

func FormatTs(ts int64) (res string)

FormatTs 格式化时间戳为字符串

func GetDayByTimeStampRange

func GetDayByTimeStampRange(startTs, endTs int64) []string

GetDayByTimeStampRange 获取时间戳之间的日期

func GetDefaultPage

func GetDefaultPage(page int) (res int)

GetDefaultPage 校验页数,小于0返回默认1

func GetDefaultPageSize

func GetDefaultPageSize(pageSize int) (res int)

GetDefaultPageSize 校验每页行数,小于0返回默认20

func GetTodayFirstTs

func GetTodayFirstTs() int64

GetTodayFirstTs 获取当天凌晨时间戳

func MapToStruct

func MapToStruct(mmap map[string]interface{}, structure interface{}) (err error)

@func 将map转为Struct @param

mmap        需要转换的map[string]interface
structure   转换后的结构体指针

@return

error       错误信息

暂不支持递归转换

func Md5String

func Md5String(str string) string

Md5String 加密

func PathExists

func PathExists(path string) (bool, error)

PathExists 判断目录是否存在

func StrArrayIndexOf

func StrArrayIndexOf(arr []string, val string) (index int, status bool)

StrArrayIndexOf 检查字符串数组中是否存在

func UniqArr

func UniqArr(arr []string) (ret []string)

UniqArr 字符串数组去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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