Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashUtils ¶
func HashUtils() *hashUtils
HashUtils is a factory method that acts as a static member
func RecoverAll ¶
func RecoverAll(cb func(v any))
RecoverAll performs recover for all panics.
Sample usage:
defer RecoverAll(func(err any) { fmt.Printf("got error: %s", err) })
func RecoverAny ¶
RecoverAny calls the callback function: cb with recovered value in case when recovered value exists in slice errors.
Sample usage:
defer recover.Any([]error{ErrorUsernameBlank, ErrorUsernameAlreadyTaken}, func(err any) { fmt.Printf("got error: %s", err) })
func RecoverOne ¶
RecoverOne calls the callback function: cb with recovered value in case when recovered value equals to e otherwise panic won't be recovered and will be propagated.
Sample usage:
defer recover.One(ErrorUsernameBlank, func(err any) { fmt.Printf("got error: %s", err) })
func SetAPISecret ¶ added in v1.1.2
SetAPISecret set the secret key and initializing vector to encode/decode API keys
func SetJWTSecret ¶ added in v1.1.2
SetJWTSecret set the private key to sign JWT token
func TokenUtils ¶ added in v1.1.2
func TokenUtils() *tokenUtils
TokenUtils is a factory method that acts as a static member
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
* TTLCache - an in-memory cache with expiration * TTLCache is a simple key/value cache in golang with the following functions: * * 1.
|
* TTLCache - an in-memory cache with expiration * TTLCache is a simple key/value cache in golang with the following functions: * * 1. |
Click to show internal directories.
Click to hide internal directories.