Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HelloHandler ¶
func HelloHandler() http.HandlerFunc
HelloHandler returns function containing a simple hello world example of an api handler
func ReadJSONBody ¶ added in v0.3.0
func ReadJSONBody(ctx context.Context, body io.ReadCloser, v interface{}, w http.ResponseWriter, data log.Data) error
ReadJSONBody reads the bytes from the provided body, and marshals it to the provided model interface.
func WriteJSONBody ¶ added in v0.3.0
WriteJSONBody marshals the provided interface into json, and writes it to the response body.
Types ¶
type AuthHandler ¶ added in v0.2.0
type AuthHandler interface {
Require(required auth.Permissions, handler http.HandlerFunc) http.HandlerFunc
}
AuthHandler interface for adding auth to endpoints
type MongoServer ¶ added in v0.2.0
type MongoServer interface { Close(ctx context.Context) error Checker(ctx context.Context, state *healthcheck.CheckState) (err error) GetTopic(id string) (topic *models.TopicResponse, err error) }
MongoServer defines the required methods from MongoDB
Click to show internal directories.
Click to hide internal directories.