Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogRequest ¶
LogRequest is a middleware that logs a request HTTP status < 400 will be logged as Info HTTP status >= 400 && < 500 will be logged as Info with the body as message HTTP status >= 500 will be logged as Error with the body as message
func RunHTTP ¶
RunHTTP starts a webserver with Wrapp logging and panic recovery The port number is fetched from the environment variable SERVICE_PORT FIXME: mylog parameter kept for legacy reasons, it should be dropped
func ValidateJSONSchema ¶
ValidateJSONSchema returns a http middleware that validates the supplied JSON schema. Will panic if the schema file can't be found and/or is invalid The validator supports streaming JSON, and will buffer all data to check its validity. If any of the streamed objects is invalid, subsequent handlers will not be called.
Types ¶
type InvalidJSONError ¶
type InvalidJSONError struct {
gojsonschema.ResultErrorFields
}
type ValidationResult ¶
type ValidationResult struct { Valid bool `json:"valid"` Errors interface{} `json:"errors"` ObjectIndex *int `json:"item,omitempty"` }
func ErrorValidationResult ¶
func ErrorValidationResult(vr *gojsonschema.Result) ValidationResult