Documentation ¶
Index ¶
- Constants
- func GetFieldsToExpand(req *http.Request) ([]string, bool)
- func GetFieldsToSelect(req *http.Request) ([]string, bool)
- func LoggingMiddleware(logger zerolog.Logger) mux.MiddlewareFunc
- func MetricsMiddleware(restCollector module.RestMetrics) mux.MiddlewareFunc
- func QueryExpandable() mux.MiddlewareFunc
- func QuerySelect() mux.MiddlewareFunc
Constants ¶
View Source
const ExpandQueryParam = "expand"
View Source
const SelectQueryParam = "select"
Variables ¶
This section is empty.
Functions ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger zerolog.Logger) mux.MiddlewareFunc
LoggingMiddleware creates a middleware which adds a logger interceptor to each request to log the request method, uri, duration and response code
func MetricsMiddleware ¶
func MetricsMiddleware(restCollector module.RestMetrics) mux.MiddlewareFunc
func QueryExpandable ¶
func QueryExpandable() mux.MiddlewareFunc
QueryExpandable middleware extracts out the 'expand' query param field if present in the request
func QuerySelect ¶
func QuerySelect() mux.MiddlewareFunc
QuerySelect middleware extracts out the 'select' query param field if present in the request
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.