Documentation ¶
Index ¶
Constants ¶
View Source
const BADLY_FORMATTED_JSON string = "Request body contains badly-formed JSON"
View Source
const MAX_REQUEST_READ_SIZE int64 = 1048576
View Source
const REQUEST_BODY_MUST_NOT_BE_EMPTY string = "Request body must not be empty"
View Source
const RESPONSE_BODY_MUST_NOT_BE_LARGER_THAN_1MB string = "Request body must not be larger than 1MB"
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONBody ¶
func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error
DecodeJSONBody decodes a request body in json form and returns a malformed request error type if any errors do occur
func ExtractIDFromRequest ¶
ExtractIdFromRequest takes as input a request object and extracts an id from it
func ProcessMalformedRequest ¶
func ProcessMalformedRequest(w http.ResponseWriter, err error)
ProcessMalformedRequest handles aggregated errors occurring from interactions with various external services
Types ¶
type JwtCustomClaims ¶
type JwtCustomClaims struct { Id string `json:"id"` jwt.StandardClaims }
type MalformedRequest ¶
MalformedRequest is a custom error type
func (*MalformedRequest) Error ¶
func (mr *MalformedRequest) Error() string
type TokenValidationResponse ¶
Click to show internal directories.
Click to hide internal directories.