Versions in this module Expand all Collapse all v1 v1.0.0 Sep 7, 2020 Changes in this version + const APIKEY + const REMOTE_ADDR_KEY + const REQUEST_ID_KEY + const SESSIONID + var ErrBadPayload = errors.New("Malformed json request payload") + func DecodeBody(ctx context.Context, data io.ReadCloser, model interface{}) (err error) + func DecodeParams(ctx context.Context, dst interface{}, src map[string][]string) (errors schema.MultiError) + func Respond(ctx context.Context, w http.ResponseWriter, data interface{}, ...) + func RespondError(ctx context.Context, w http.ResponseWriter, httpStatusCode int, err error) + func RespondSuccess(ctx context.Context, w http.ResponseWriter, data interface{}) + func ValidationRules() *validator.Validate + type API struct + Router *mux.Router + func New(ctx context.Context, conf *apisettings.Service, handlers []Handler) *API + type BaseHandler struct + func (h *BaseHandler) InitRoutes(ctx context.Context, r *mux.Router) + type ConsumerErrors struct + Errors []ResponseError + type Handler interface + InitRoutes func(context.Context, *mux.Router) + type ResponseErr interface + Error func() string + type ResponseError struct + Code string + Message string + Properties []ResponsePropertyError + func (re ResponseError) Error() string + type ResponsePropertyError struct + Constraints []string + Property string