Versions in this module Expand all Collapse all v0 v0.0.1 Jan 26, 2025 Changes in this version + const EmailRegexPattern + const PasswordRegexPattern + const PhoneRegexPattern + const PinRegexPattern + var RegexPassword = regexp2.MustCompile(PasswordRegexPattern, 0) + var RegexPin = regexp2.MustCompile(PinRegexPattern, 0) + var RegexpEmail = regexp2.MustCompile(EmailRegexPattern, 0) + var RegexpPhone = regexp2.MustCompile(PhoneRegexPattern, 0) + func GetJSONTag(fld reflect.StructField) string + func HTTPErrorResponse(c echo.Context, e error) error + func Is(e KisaError, k Kind) bool + type FieldValidationError struct + Error error + FieldName string + func (f FieldValidationError) MarshalJSON() ([]byte, error) + type Kerror struct + Fields map[string]string + Kind string + Message string + Status int + func Tokerror(e error) *Kerror + func (k *Kerror) With(contextArgs ...interface{}) KisaError + func (k Kerror) Code() int + func (k Kerror) Error() string + func (k Kerror) GetKind() string + func (k Kerror) GetMessage() string + func (k Kerror) GetValidationFields() map[string]string + func (k Kerror) Unwrap() error + type Kind uint8 + const ErrDatabase + const ErrEchoServer + const ErrForbidden + const ErrInternalServer + const ErrInvalidJWTClaims + const ErrInvalidRequest + const ErrInvalidToken + const ErrNoToken + const ErrNotFound + const ErrRequestTimeout + const ErrResourceConflict + const ErrUnauthorized + const ErrUnkown + const ErrValidation + func (k Kind) String() string + type KisaError interface + Code func() int + Error func() string + GetKind func() string + GetMessage func() string + GetValidationFields func() map[string]string + With func(...interface{}) KisaError + func BindError(err error, message string) KisaError + func DatabaseError(err error, log logam.Logger) KisaError + func ForbidenError(message string, err error) KisaError + func InternalServerError(err error) KisaError + func InvalidApiKeyError(err error) KisaError + func InvalidAuthMethodError(err error) KisaError + func InvalidJWTClaimsError(err error) KisaError + func InvalidKeyAttributesError(err error) KisaError + func InvalidRequestError(message string, err error) KisaError + func InvalidTokenError(err error) KisaError + func NoTokenError(err error) KisaError + func NotFoundError(message string, err error) KisaError + func ResourceConflictError(message string, err error) KisaError + func UnauthorizedError(message string, err error) KisaError + func ValidationError(err validationFields) KisaError + type LogContext map[string]interface + type Validator struct + func New() *Validator + func (v *Validator) VStruct(s interface{}) []FieldValidationError