Documentation ¶
Index ¶
- Constants
- Variables
- func BrowserTimeToServerTime(ctx *gin.Context, browserTimeStr string) (string, error)
- func CamelToSnake(s string) string
- func CleanString(input string) string
- func ConvertGB2312INItoUTF8(iniFile string) ([]byte, error)
- func ConvertSingleFiled(ctx *gin.Context, timeStr, layout string) string
- func Decrypt(encryptedText, salt string) (string, error)
- func Encrypt(plainText, salt string) (string, error)
- func GenerateCode(num int) string
- func GenerateID() int64
- func GenerateIDStr() string
- func GenerateRandomNumberString(length int) string
- func GetCaptchaExpireKey(captchaID string) string
- func GetEmailActivateKey(code string) string
- func GetEmailActivateSuccessKey(code string) string
- func GetFileMD5(path string) (string, error)
- func Md532(str string) string
- func Md5To16(str string) string
- func Md5_32_sha1(str string) string
- func PrettyJson(is *string)
- func RemoveSuffix(filename string) string
- func SHA1(s string) string
- func ServerTimeToBrowserTime(ctx *gin.Context, fields []string, param interface{}) interface{}
- func ServerTimeToBrowserTimeWS(tz string, fields []string, param interface{}) interface{}
- func SetEmailActivateSuccess(code string, email string)
- func SnowflakeInit(machineID int64) error
- func Unique(stringSlice []string) []string
- type TimeConverter
Constants ¶
View Source
const InvitationCryptKey = "iEA8wIl8J6vA5OVWrSt6UNiXVLaLOykH5YQKNI"
Variables ¶
View Source
var (
OrderFileInstanceLayout = "20060102-15_04_05.000"
)
Functions ¶
func BrowserTimeToServerTime ¶
BrowserTimeToServerTime 转换浏览器时间为服务器时间
func CleanString ¶
func ConvertGB2312INItoUTF8 ¶
func ConvertSingleFiled ¶
ConvertSingleFiled 尝试解析时间字符串并转换为指定时区
func GetCaptchaExpireKey ¶
func GetEmailActivateKey ¶
func GetEmailActivateSuccessKey ¶
调用注册或其他需要验证邮箱激活成功时使用此函数获取对应的key以验证是否成功激活过邮箱
func GetFileMD5 ¶
GetFileMD5 计算文件的 MD5 值 @param: path string文件路径 /data/file1.png
func ServerTimeToBrowserTime ¶
ServerTimeToBrowserTime 转换接口返回的时间值为当地时间
func ServerTimeToBrowserTimeWS ¶
ServerTimeToBrowserTimeWS 转换接口返回的时间值为当地时间
func SetEmailActivateSuccess ¶
成功验证邮箱后设置一个redis key
Types ¶
type TimeConverter ¶
type TimeConverter struct {
// contains filtered or unexported fields
}
func (*TimeConverter) Convert ¶
func (tc *TimeConverter) Convert(param interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.