Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func DecodeError(w http.ResponseWriter, r *http.Request, l *logger.Logger, apiErr string, ...)
- func HashPassword(password string, cost int) (string, error)
- func MarshalBinary(d interface{}) ([]byte, error)
- func SearchValidatorMessage(w http.ResponseWriter)
- func UnmarshalBinary(d []byte, v interface{}) error
- func ValidatorMessage(w http.ResponseWriter, err error)
- type APIMessage
- type APIValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash checks if the given passwords matches.
func DecodeError ¶
func DecodeError( w http.ResponseWriter, r *http.Request, l *logger.Logger, apiErr string, code int, )
DecodeError handles API errors.
func HashPassword ¶
HashPassword encrypts a given password using bcrypt algorithm.
func MarshalBinary ¶
MarshalBinary is a implementation of BinaryMarshaler interface.
func SearchValidatorMessage ¶
func SearchValidatorMessage(w http.ResponseWriter)
SearchValidatorMessage handles search validation errors.
func UnmarshalBinary ¶
UnmarshalBinary is a implementation of BinaryUnmarshaler interface.
func ValidatorMessage ¶
func ValidatorMessage(w http.ResponseWriter, err error)
ValidatorMessage handles validation error messages.
Types ¶
type APIMessage ¶
type APIMessage struct { Message string `json:"message,omitempty"` Status int `json:"status,omitempty"` }
APIMessage is a struct for generic JSON response.
type APIValidator ¶
type APIValidator struct {
Errors []*APIMessage `json:"errors"`
}
APIValidator type is a struct for multiple error messages.
Click to show internal directories.
Click to hide internal directories.