api

package
v0.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package api provides controllers for each api endpoint. Controllers are "dumb wiring"; there is little to no application logic in this package. Controllers call and coordinate other packages to satisfy the api endpoint.

Index

Constants

View Source
const (
	API_ROOT = "/api/v1/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API provides controllers for endpoints it registers with a router. It satisfies the http.HandlerFunc interface.

func NewAPI

func NewAPI(rm request.Manager, stat status.Manager) *API

NewAPI cretes a new API struct. It initializes an echo web server within the struct, and registers all of the API's routes with it.

func (*API) ServeHTTP

func (api *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP allows the API to statisfy the http.HandlerFunc interface.

func (*API) Use

func (api *API) Use(middleware ...echo.MiddlewareFunc)

Use adds middleware to the echo web server in the API. See https://echo.labstack.com/middleware for more details.

Jump to

Keyboard shortcuts

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