Documentation
¶
Index ¶
- Variables
- func CompareHashedAndPlain(hashed, plain string) bool
- func ContextClaimExpiration(r *http.Request) (time.Time, error)
- func ContextClaimID(r *http.Request) (int, error)
- func GenerateRandomCode(lenght int) (string, error)
- func Hash(password string) (string, error)
- func Request(method string, headers map[string]string, endpoint string, payload any) (*http.Response, error)
- func Response(w http.ResponseWriter, status int, v any) error
- func Unmarshal(w http.ResponseWriter, r *http.Request, payload any) error
- func Validate(w http.ResponseWriter, r *http.Request, payload any) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Validator = validator.New(validator.WithRequiredStructEnabled())
Global instance of the validator
Functions ¶
func CompareHashedAndPlain ¶
Compares hashed strings with plaintext ones
func ContextClaimExpiration ¶
Claims the jwt expiration from the request
func ContextClaimID ¶
Claims the account's id from the request
func GenerateRandomCode ¶
Generating a random alphanumeric code
func Request ¶
func Request(method string, headers map[string]string, endpoint string, payload any) (*http.Response, error)
Sends a request
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.