Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadJSONBody ¶ added in v1.10.0
func ReadJSONBody(ctx context.Context, body io.ReadCloser, v interface{}) error
ReadJSONBody reads the bytes from the provided body, and marshals it to the provided model interface.
func WriteJSONBody ¶ added in v1.10.0
func WriteJSONBody(v interface{}, w http.ResponseWriter, httpStatus int) error
WriteJSONBody marshals the provided interface into json, and writes it to the response body.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func Setup ¶
func Setup(ctx context.Context, host string, router *mux.Router, dataStore interfaces.DataStore, hc interfaces.HealthChecker) *API
Setup sets up the endpoints.
Click to show internal directories.
Click to hide internal directories.