common

package
v0.0.0-...-53e17f9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTMLEMailTemplate = `` /* 428-byte string literal not displayed */

HTMLEMailTemplate 超文本标记邮件模版

Functions

func DecodeBase64

func DecodeBase64(str string) (dcs string)

DecodeBase64 base64解密字符串

func EncodeBase64

func EncodeBase64(str string) (ecs string)

EncodeBase64 base64加密字符串

func GenerateToken

func GenerateToken(username string) (string, error)

GenerateToken 生成令牌 https://godoc.org/github.com/dgrijalva/jwt-go#NewWithClaims

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 GetMinute

func GetMinute() (date string)

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

func GetMonth

func GetMonth() (date string)

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

func GetSecond

func GetSecond() (date string)

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

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 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 发送文本邮件

Types

type JwtClaims

type JwtClaims struct {
	Username           string `json:"username"`
	jwt.StandardClaims        // jwt包中的默认字段
}

JwtClaims 结构体

func ParseToken

func ParseToken(tokenString string) (*JwtClaims, error)

ParseToken 解析令牌 https://godoc.org/github.com/dgrijalva/jwt-go#ParseWithClaims

Jump to

Keyboard shortcuts

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