api

package
v0.0.0-...-bcf6333 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadRequestRouteParameter = errors.New("api: bad request route parameter")

ErrBadRequestRouteParameter is a sentinel error indicating a route parameter could not be parsed or found.

Functions

This section is empty.

Types

type API

type API struct {
	//Bus is a command bus that is used to execute commands to update entities
	//within the API.
	Bus *cbus.Bus

	//Users is a query repository used to retrieve Users.
	Users user.QueryRepo

	//Clients is a query repository used to retrieve Clients.
	Clients client.QueryRepo
}

API allows for handling all incoming requests dealing with the application's API. Its Handler method should be used for serving API requests.

All fields must be non-nil and safe for use by multiple goroutintes due to their use inside a http.Server and http.Handler.

func (*API) Handler

func (a *API) Handler() http.Handler

Handler returns an http.Handler that serves all requests for a.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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