Documentation ¶
Index ¶
- func ComparePasswords(plain, hashed string) bool
- func Encode(body JWT) (*string, *int64, error)
- func EncodeUUID(uuid string) string
- func GenerateBase58UUID() string
- func GenerateNanoUUID() (string, error)
- func GeneratePassword(plain string) (*string, error)
- func GenerateUUID() string
- func IsUUID(value string) bool
- func Sanitize(token string) bool
- func SplitJWT(token string) (header, payload, signature *string)
- type Claims
- type JWT
- type Profile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
ComparePasswords receives the plain and the hashed password, encodes the first one and, tries to compare both of them. It returns true if they are equal. Returns false in any other case.
func Encode ¶
Encode receives a JWT body and retrieves the access token and the time for it to expire. If there is an error, an error is returned instead.
func EncodeUUID ¶
EncodeUUID receives an UUID and encodes it using base 58.
func GenerateBase58UUID ¶
func GenerateBase58UUID() string
GenerateShortUUID generates an UUID and encodes it using base58.
func GenerateNanoUUID ¶
GenerateNanoUUID generates a user-friendly UUID of length 8.
func GeneratePassword ¶
GeneratePassword generates a bcrypt password from the given plain password.
Types ¶
type Claims ¶
type Claims struct { Profile Profile `json:"profile,omitempty"` jwt.StandardClaims }
Claims extends the default claims from the JWT package.
Click to show internal directories.
Click to hide internal directories.