Documentation ¶
Index ¶
- func ParsePathString(w http.ResponseWriter, r *http.Request, key string) (string, int)
- func ParsePrimitiveID(w http.ResponseWriter, r *http.Request) primitive.ObjectID
- func RespondWithError(w http.ResponseWriter, code int, message string)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePathString ¶
ParsePathString parses the string value from the route and returns it stats 0 -> ok || status 1 -> error
func ParsePrimitiveID ¶
ParsePrimitiveID parses the id from the route and returns it returns primitive.NilObjectID if an error occured sends a respond if an error occured
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, message string)
RespondWithError Creates an error payload and adds the error message to be returned
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON parses the passed payload and returns it with the specified code to the client
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.