Documentation ¶
Index ¶
- func Int32PointerFromQueryParam(r *http.Request, paramName string) (*int32, error)
- func Int64ArrayFromQueryParam(r *http.Request, paramName string) ([]int64, error)
- func ReturnProblem(w http.ResponseWriter, detail, code string, status int, innerErr error) (int, []byte)
- func TimestampFromQueryParam(r *http.Request, paramName string) (*time.Time, error)
- func WriteJSONResponse(w http.ResponseWriter, status int, data interface{}) error
- func WriteProblem(w http.ResponseWriter, detail, code string, status int, innerErr error) error
- type PagingParams
- type Server
- type Sort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int32PointerFromQueryParam ¶
Int32PointerFromQueryParam returns a nullable int32 from a query param key
func ReturnProblem ¶
func ReturnProblem(w http.ResponseWriter, detail, code string, status int, innerErr error) (int, []byte)
ReturnProblem will return a json http problem response
func TimestampFromQueryParam ¶
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, status int, data interface{}) error
WriteJSONResponse will write a json response to the htt.ResponseWriter
func WriteProblem ¶
WriteProblem will write a json http problem response
Types ¶
type PagingParams ¶
type PagingParams struct { PageSize *int32 `json:"page_size"` Offset *int32 `json:"offset"` SortFields []Sort `json:"sort_fields"` }
PagingParams represents paging and sorting parameter values
func ParsePagingParams ¶
func ParsePagingParams(r *http.Request, defaults PagingParams, sortFieldsWhitelist []string) (PagingParams, error)
ParsePagingParams retrieves paging params from the request, allows for whitelisting sort field values
Click to show internal directories.
Click to hide internal directories.