Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MsgInvalidJson = "Invalid JSON format" MsgInvalidJsonType = func(e *json.UnmarshalTypeError) string { return "Expected " + e.Value + " but given type is " + e.Type.String() + " in JSON" } MsgValidationFailed = "Invalid inputs" MsgValidationFieldFailed = func(e *validator.FieldError) string { switch e.Tag { case "required": return "Input required" } return "Invalid input format [" + e.Tag + "]" } )
Functions ¶
func ConnectDB ¶
func ConnectDB(dbSession *mgo.Session) gin.HandlerFunc
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
Types ¶
type ClientError ¶
type ClientError struct { Message string `json:"message,omitempty"` Errors []ClientFieldError `json:"errors,omitempty"` }
type ClientFieldError ¶
Click to show internal directories.
Click to hide internal directories.