Documentation ¶
Index ¶
- Constants
- func GetKeyFromAlgo(algo, secret, keyPath string) (interface{}, error)
- func GetTokenAndKeyFromAlgo(algo, secret, keyPath string) (*jwt.Token, interface{}, error)
- func LoadECDSAKeyFromFile(filename string, isPrivate bool) (any, error)
- func NewError(c *fiber.Ctx, logger *zap.Logger, msg, details string, err error) *fiber.Error
- type HTTPError
- type ValidatorError
- type ValidatorErrors
Constants ¶
View Source
const ( StatusBadRequest = 400 StatusPaymentRequired = 402 StatusForbidden = 403 StatusNotFound = 404 StatusMethodNotAllowed = 405 StatusNotAcceptable = 406 StatusProxyAuthRequired = 407 StatusRequestTimeout = 408 StatusConflict = 409 StatusGone = 410 StatusLengthRequired = 411 StatusPreconditionFailed = 412 StatusRequestEntityTooLarge = 413 StatusRequestURITooLong = 414 StatusUnsupportedMediaType = 415 StatusRequestedRangeNotSatisfiable = 416 StatusExpectationFailed = 417 StatusTeapot = 418 StatusMisdirectedRequest = 421 StatusUnprocessableEntity = 422 StatusLocked = 423 StatusFailedDependency = 424 StatusTooEarly = 425 StatusUpgradeRequired = 426 StatusPreconditionRequired = 428 StatusTooManyRequests = 429 StatusRequestHeaderFieldsTooLarge = 431 StatusInternalServerError = 500 StatusNotImplemented = 501 StatusBadGateway = 502 StatusGatewayTimeout = 504 StatusHTTPVersionNotSupported = 505 StatusVariantAlsoNegotiates = 506 StatusInsufficientStorage = 507 StatusLoopDetected = 508 StatusNotExtended = 510 StatusNetworkAuthenticationRequired = 511 )
Error status codes
Variables ¶
This section is empty.
Functions ¶
func GetKeyFromAlgo ¶
GetKeyFromAlgo returns a key from an algorithm and a secret
func GetTokenAndKeyFromAlgo ¶
GetTokenAndKeyFromAlgo returns a token and a key from an algorithm and a secret
func LoadECDSAKeyFromFile ¶
LoadECDSAKeyFromFile loads an ECDSA private or public key from a file
Types ¶
type HTTPError ¶
type HTTPError struct { Code int `json:"code"` Message string `json:"message"` Details interface{} `json:"details,omitempty"` Err error `json:"-"` }
HTTPError represents an HTTP error.
func NewHTTPError ¶
NewHTTPError returns a new HTTPError.
type ValidatorError ¶
ValidatorError represents error validation struct.
type ValidatorErrors ¶
type ValidatorErrors []ValidatorError
ValidatorErrors is a slice of ValidatorError.
func ValidateStruct ¶
func ValidateStruct(task interface{}) (errors ValidatorErrors)
ValidateStruct checks if a struct is valid and returns an array of errors if it is not valid.
Click to show internal directories.
Click to hide internal directories.