Documentation ¶
Index ¶
- func ContentJSON(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, ...)
- func Created(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, ...)
- func ErrorOrStatus(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, ...)
- func Health(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, ...)
- func NoContent(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, ...)
- func Status(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentJSON ¶
func ContentJSON(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, w http.ResponseWriter, body []byte)
ContentJSON writes JSON bytes to the response writer with status code OK
func Created ¶
func Created(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, w http.ResponseWriter, location string)
Created writes location header to response writer with status code Created
func ErrorOrStatus ¶
func ErrorOrStatus(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, w http.ResponseWriter, err error)
ErrorOrStatus wraps Status if error is a Status, otherwise writes status code Internal Server Error
func Health ¶
func Health(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, w http.ResponseWriter, serviceName string)
ContentJSON writes a small JSON body to the response writer with status code OK
Used for health check endpoints to ensure API is serving
func NoContent ¶
func NoContent(ctx context.Context, headersClient go_headers.Client, logClient go_log.Client, w http.ResponseWriter)
NoContent writes status code No Content
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.