Documentation ¶
Index ¶
- func ClaimsFromHeader(ctx context.Context) (*casdoor.Claims, error)
- func ComparePasswords(hashedPassword, password string) error
- func DownloadAudioFileToTmp(urlStr string) (string, error)
- func EventIdStr(eventId string) string
- func GenerateToken(identity, name string) (string, error)
- func GetMd5(s string) string
- func GetMp3UrlDuration(url string) (int64, error)
- func GetRand() string
- func GetUUID() string
- func HashPassword(password string) (string, error)
- func Int32SliceToString(sli []int32, sep string) string
- func Int64SliceToString(sli []int64, sep string) string
- func NanoTimestampStr() string
- func ParseFileDuration(filePath string) (int64, error)
- func ReceiveEmail(str string) string
- func ReceiveWebhook(str string) string
- func S2M(inter interface{}) map[string]interface{}
- func TenantIDFromHeader(ctx context.Context) (string, error)
- func Uint32SliceToString(sli []uint32, sep string) string
- func Uint64SliceToString(sli []uint64, sep string) string
- func Uint64SliceToStringSlice(sli []uint64) []string
- func UnixSecondToInt64() int64
- func UnixSecondToStr(second int64) string
- func UnixSecondToTime(second int64) time.Time
- func UserFromHeader(ctx context.Context) (*casdoor.User, error)
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
ComparePasswords 验证密码是否匹配哈希值
func DownloadAudioFileToTmp ¶
func EventIdStr ¶
func GenerateToken ¶
GenerateToken 生成 token
func GetMp3UrlDuration ¶
func HashPassword ¶
HashPassword 使用 bcrypt 对密码进行哈希处理
func Int32SliceToString ¶
func Int64SliceToString ¶
func NanoTimestampStr ¶
func NanoTimestampStr() string
func ParseFileDuration ¶
ParseFileDuration 解析音频文件时长 原生go的方式
func ReceiveEmail ¶
func ReceiveWebhook ¶
func Uint32SliceToString ¶
func Uint64SliceToString ¶
func UnixSecondToInt64 ¶
func UnixSecondToInt64() int64
func UnixSecondToStr ¶
func UnixSecondToTime ¶
Types ¶
type UserClaims ¶
type UserClaims struct { Identity string `json:"identity"` Name string `json:"name"` jwt.StandardClaims }
func AnalyseToken ¶
func AnalyseToken(tokenString string) (*UserClaims, error)
AnalyseToken 解析 token
Click to show internal directories.
Click to hide internal directories.