api

package
v0.8.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0 Imports: 10 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(appCtx app.Context, rm request.Manager, jls joblog.Store, stat status.Manager) *API

NewAPI creates a new API struct. It initializes an echo web server within the struct, and registers all of the API's routes with it. @todo: create a struct of managers and pass that in here instead?

func (*API) Run

func (api *API) Run() error

func (*API) ServeHTTP

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

Jump to

Keyboard shortcuts

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