Documentation
¶
Index ¶
- Constants
- func AesDecrypt(cryted string, key string) string
- func AesEncrypt(orig string, key string) string
- func Base64Decode(scr string) ([]byte, error)
- func Base64Encode(src []byte) string
- func BitToMb(b int64) int64
- func CreateUUID() string
- func CstTimeToTimestampUnix(value string) (int64, error)
- func CstTimeToTimestampUnixMilli(value string) (int64, error)
- func FileExists(path string) bool
- func GenerateUuid() string
- func GetAllFile(pathname string, s []string) ([]string, error)
- func HourToFullFmt(timeStr string) (string, error)
- func InSlice(key interface{}, slice interface{}) bool
- func MapSliceToStructSlice(maps []map[string]interface{}, outSlice interface{}) error
- func MapToStruct(m map[string]interface{}, obj interface{}) error
- func NowUtc() string
- func PKCS7Padding(ciphertext []byte, blocksize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func ReadFromFile(filename string) (string, error)
- func RemoveRepByMap(slc []string) []string
- func SendDingTalkActionCard(webhook string, actionCard DingTalkActionCard, at []string, isAtAll bool) error
- func SendDingTalkMessage(webhook string, content string, at []string, isAtAll bool) error
- func TimeParseYYYYMMDD(value string) (time.Time, error)
- func TimeToTimestampUnix(value string) (int64, error)
- func TimeToTimestampUnixMilli(value string) (int64, error)
- func TimeparseyyyyMmDdHhmmsslayout(value string) (time.Time, error)
- func TimestampToTime(value int64) time.Time
- func WriteLinesToFile(filename, content string, _append bool) error
- func WriteToFile(filename, content string) error
- type DingTalkActionCard
Constants ¶
const ( Layout1 = "2006-01-02T15:04:05.000Z" UTC8Layout = "2006.01.02 15:04:05-0700" YYYY_MM_DD_Layout = "2006-01-02" YYYYmmddHHMMSSLayout = "20060102150405" YYYY_mm_dd_HHMMSSLayout = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func AesEncrypt ¶
AesEncrypt 加密 key 的长度最少为16位 最好是16/24/32 位
func CreateUUID ¶
func CreateUUID() string
func CstTimeToTimestampUnix ¶
CstTimeToTimestampUnix 2006-01-02 15:04:05 类型的 字符串转换成 timestamp, 从 1790 timestamp 是指格林威治时间1970年01月01日00时00分00秒 (北京时间1970年01月01日08时00分00秒)起至现在的总秒数。 时间需要是 UTC 时间
func CstTimeToTimestampUnixMilli ¶
CstTimeToTimestampUnixMilli 时间戳转化为 时间字符串 转化后的格式为 2006-01-02 15:04:05 2006-01-02 15:04:05 类型的 字符串转换成 timestamp 毫秒数 时间需要是 CTS 时间 , UTC+8的时间
func GetAllFile ¶
GetAllFile 遍历文件夹获取所有文件
func HourToFullFmt ¶
HourToFullFmt 输入: 15:04 要求输出 : 2006-01-02T15:04:05.000Z
func MapSliceToStructSlice ¶
MapSliceToStructSlice 将 []map 转换为 []struct,并直接修改传入的切片
func MapToStruct ¶
MapToStruct 将单个 map 转换为 struct
func ReadFromFile ¶
func SendDingTalkActionCard ¶ added in v1.5.5
func SendDingTalkActionCard(webhook string, actionCard DingTalkActionCard, at []string, isAtAll bool) error
func SendDingTalkMessage ¶ added in v1.5.5
func TimeParseYYYYMMDD ¶
TimeParseYYYYMMDD 2006-01-02 类型的 字符串转换成 time.TIme
func TimeToTimestampUnix ¶
TimeToTimestampUnix 2006-01-02 15:04:05 类型的 字符串转换成 timestamp, 从 1790 timestamp 是指格林威治时间1970年01月01日00时00分00秒 (北京时间1970年01月01日08时00分00秒)起至现在的总秒数。 时间需要是 UTC 时间
func TimeToTimestampUnixMilli ¶
TimeToTimestampUnixMilli 2006-01-02 15:04:05 类型的 字符串转换成 timestamp 毫秒数 时间需要是 UTC 时间
func TimeparseyyyyMmDdHhmmsslayout ¶
TimeparseyyyyMmDdHhmmsslayout 2006-01-02 15:04:05 类型的 字符串转换成 time.TIme 时间需要是Utc 时间
func TimestampToTime ¶
TimestampToTime 时间戳转化为时间 time.Time