Documentation
¶
Index ¶
- func ConvertBsonTimeToString(dateTime bson.DateTime) string
- func ConvertByteHashToString(hash []byte) string
- func ConvertStringHashToByte(hash string) []byte
- func ConvertStringToOrdered[T constraints.Ordered](s string, v *T) error
- func Crypt(password string) (string, error)
- func EnvInit()
- func ErrResp(c *app.RequestContext, err error)
- func GetSHA256Byte(data string) []byte
- func GetSHA256String(data string) string
- func LoadEnvFile(fileName string)
- func MillTimeStampToTime(timestamp int64) time.Time
- func NewFileName(user_id, time int64) string
- func SecondTimeStampToTime(timestamp int64) time.Time
- func URLconvert(ctx context.Context, c *app.RequestContext, path string) (fullURL string)
- func UrlConvertReverse(ctx context.Context, fullURL string) (path string)
- func ValidatePassword(password string) error
- func VerifyPassword(password, hashedPassword string) bool
- type BaseResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBsonTimeToString ¶
func ConvertByteHashToString ¶
ConvertByteHashToString 将 byte 类型的哈希转换为字符串哈希
func ConvertStringHashToByte ¶
ConvertStringHashToByte 将字符串哈希转换为 byte 类型的哈希
func ConvertStringToOrdered ¶
func ConvertStringToOrdered[T constraints.Ordered](s string, v *T) error
ConvertStringToOrdered 将字符串转换为指定类型的值
func ErrResp ¶
func ErrResp(c *app.RequestContext, err error)
func GetSHA256Byte ¶
func GetSHA256String ¶
func LoadEnvFile ¶
func LoadEnvFile(fileName string)
LoadEnvFile please put env file in /envs directory before using this func
func MillTimeStampToTime ¶
MillTimeStampToTime convert ms timestamp to time.Time
func NewFileName ¶
NewFileName Splicing user_id and time to make unique filename
func SecondTimeStampToTime ¶
SecondTimeStampToTime convert s timestamp to time.Time
func URLconvert ¶
URLconvert Convert the path in the database into a complete url accessible by the front end
func UrlConvertReverse ¶
UrlConvertReverse 从完整URL还原数据库中存储的相对路径
func ValidatePassword ¶
ValidatePassword 验证密码,长度至少8位,并且包含字母和数字
func VerifyPassword ¶
VerifyPassword Verify the password is consistent with the hashed password in the database
Types ¶
Click to show internal directories.
Click to hide internal directories.