common

package
v0.0.0-...-34b391d Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FormatYear 年
	FormatYear = "2006"
	// FormatMonth 月
	FormatMonth = "01"
	// FormatDay 日
	FormatDay = "02"
	// FormatHour 时
	FormatHour = "15"
	// FormatMinute 分
	FormatMinute = "04"
	// FormatSecond 秒
	FormatSecond = "05"
	// FormatYearMonthDay 年月日
	FormatYearMonthDay = "2006-01-02"
	// FormatHourMinuteSecond 时分秒
	FormatHourMinuteSecond = "15:04:05"
	// FormatYearMonthDayHourMinuteSecond 年月日时分秒
	FormatYearMonthDayHourMinuteSecond = "2006-01-02 15:04:05"
)
View Source
var HTMLEMailTemplate = `` /* 428-byte string literal not displayed */

HTMLEMailTemplate 超文本标记邮件模版

Functions

func CreateFullPathFileName

func CreateFullPathFileName(fullPathFileName string) bool

CreateFullPathFileName 创建全路径文件 成功返回true,失败返回false

func CreateQRCodeFile

func CreateQRCodeFile(content string, fullPathFileName string) bool

CreateQRCodeFile 创建二维码,成功返回true,失败返回false

func DecodeBase64

func DecodeBase64(str string) (dcs string)

DecodeBase64 base64解密字符串

func EncodeBase64

func EncodeBase64(str string) (ecs string)

EncodeBase64 base64加密字符串

func GetDay

func GetDay() (date string)

GetDay 获取日,输出格式“02”

func GetHour

func GetHour() (date string)

GetHour 获取时,输出格式“15”

func GetHourMinuteSecond

func GetHourMinuteSecond() (date string)

GetHourMinuteSecond 获取时分秒,输出格式“15:04:05”

func GetHourMinuteSecondDifference

func GetHourMinuteSecondDifference(t1String string, t2String string) (date string)

GetHourMinuteSecondDifference 获取时分秒差,输出格式“1时1分1秒”

func GetHoursDifference

func GetHoursDifference(t1String string, t2String string) (date string)

GetHoursDifference 获取时差,输出格式“1”时

func GetMinute

func GetMinute() (date string)

GetMinute 获取分,输出格式“04”

func GetMinutesDifference

func GetMinutesDifference(t1String string, t2String string) (date string)

GetMinutesDifference 获取分差,输出格式“1”分

func GetMonth

func GetMonth() (date string)

GetMonth 获取月,输出格式“01”

func GetSecond

func GetSecond() (date string)

GetSecond 获取秒,输出格式“05”

func GetSecondsDifference

func GetSecondsDifference(t1String string, t2String string) (date string)

GetSecondsDifference 获取秒差,输出格式“1”秒

func GetYear

func GetYear() (date string)

GetYear 获取年,输出格式“2006”

func GetYearMonthDay

func GetYearMonthDay() (date string)

GetYearMonthDay 获取年月日,输出格式“2006-01-02”

func GetYearMonthDayHourMinuteSecond

func GetYearMonthDayHourMinuteSecond() (date string)

GetYearMonthDayHourMinuteSecond 获取年月日时分秒,输出格式“2006-01-02 15:04:05”

func HMACAndMD5v1

func HMACAndMD5v1(key string, s string) (r string)

HMACAndMD5v1 HMAC(MD5)生成方式1

func HMACAndMD5v2

func HMACAndMD5v2(key string, s string) (r string)

HMACAndMD5v2 HMAC(MD5)生成方式2

func HMACAndSHA1v1

func HMACAndSHA1v1(key string, s string) (r string)

HMACAndSHA1v1 HMAC(SHA1)生成方式1

func HMACAndSHA1v2

func HMACAndSHA1v2(key string, s string) (r string)

HMACAndSHA1v2 HMAC(SHA1)生成方式2

func MD5v1

func MD5v1(s string) (r string)

MD5v1 MD5生成方式1

func MD5v2

func MD5v2(s string) (r string)

MD5v2 MD5生成方式2

func MD5v3

func MD5v3(s string) (r string)

MD5v3 MD5生成方式3

func SHA1v1

func SHA1v1(s string) (r string)

SHA1v1 SHA1生成方式1

func SHA1v2

func SHA1v2(s string) (r string)

SHA1v2 SHA1生成方式2

func SHA1v3

func SHA1v3(s string) (r string)

SHA1v3 SHA1生成方式3

func SendHTMLEMail

func SendHTMLEMail(to string, subject string, text string) (err error)

SendHTMLEMail 发送超文本标记邮件

func SendTextEMail

func SendTextEMail(to string, subject string, text string) (err error)

SendTextEMail 发送文本邮件

func UUIDv1

func UUIDv1() string

UUIDv1 基于时间的编号(唯一)

func UUIDv2

func UUIDv2() string

UUIDv2 基于分布式计算环境的编号(安全)

func UUIDv3

func UUIDv3() string

UUIDv3 基于命名空间的编号(MD5)

func UUIDv4

func UUIDv4() string

UUIDv4 基于随机数的编号(唯一)

func UUIDv5

func UUIDv5() string

UUIDv5 基于命名空间的编号(SHA1)

Types

This section is empty.

Jump to

Keyboard shortcuts

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