api

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: MIT Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL