utils

package
v0.0.0-...-13a9a9d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crypt

func Crypt(password string) (string, error)

Crypt Encrypt the password using crypto/bcrypt

func MillTimeStampToTime

func MillTimeStampToTime(timestamp int64) time.Time

MillTimeStampToTime convert ms timestamp to time.Time

func NewFileName

func NewFileName(user_id, time int64) string

NewFileName Splicing user_id and time to make unique filename

func SecondTimeStampToTime

func SecondTimeStampToTime(timestamp int64) time.Time

SecondTimeStampToTime convert s timestamp to time.Time

func URLconvert

func URLconvert(ctx context.Context, c *app.RequestContext, path string) (fullURL string)

URLconvert Convert the path in the database into a complete url accessible by the front end

func VerifyPassword

func VerifyPassword(password, hashedPassword string) bool

VerifyPassword Verify the password is consistent with the hashed password in the database

Types

type BaseResp

type BaseResp struct {
	StatusCode int32
	StatusMsg  string
}

func BuildBaseResp

func BuildBaseResp(err error) *BaseResp

BuildBaseResp convert error and build BaseResp

Jump to

Keyboard shortcuts

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