Documentation
¶
Index ¶
Constants ¶
View Source
const HealthcheckPath = "/healthcheck"
Variables ¶
View Source
var GitSHA string
GitSHA populated at build-time with: -ldflags "-X github.com/cbsinteractive/bakery/handlers.GitSHA=$(git rev-parse HEAD)"
Functions ¶
Types ¶
type ErrorResponse ¶ added in v0.1.5
type ErrorResponse struct {
Message string `json:"message"`
Errors map[string][]string `json:"errors"`
Err error `json:"-"`
}
ErrorResponse holds the errore response message
func NewErrorResponse ¶ added in v0.1.5
func NewErrorResponse(message string, err error) ErrorResponse
NewErrorResponse holds a formatted error response Errors returned from the parser, origin, filter packages Will return in a `key: err` format. Where the key signals the package scope source of the error
func (*ErrorResponse) HandleError ¶ added in v0.1.5
func (e *ErrorResponse) HandleError(ctx context.Context, w http.ResponseWriter, code int)
HandleError will both log and handle the http error for a given error response
type Healthcheck ¶ added in v0.1.18
type Healthcheck struct {
GitSHA string `json:"git_sha"`
}
Healthcheck is returned when querying for service health
type HealthcheckHandler ¶ added in v0.1.18
type HealthcheckHandler struct{}
HealthcheckHandler responds to health check requests
func (HealthcheckHandler) ServeHTTP ¶ added in v0.1.18
func (HealthcheckHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP will return a http.StatusOK code if the service is up
Click to show internal directories.
Click to hide internal directories.