handlers

package
v0.0.0-...-dc36351 Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeIndex

func ServeIndex(w http.ResponseWriter, r *http.Request)

ServeIndex responds with index.html view

Types

type EndpointHandler

type EndpointHandler interface {
	// Serve is called by the `handler` struct defined in this file (handlers.go)
	// Given application context and an http request.
	// Returns an interface to serve back to the client (Cannot contain the "error" key) and a point to an models.APIError
	// both can be nil
	Serve(ctx *models.AppContext, r *http.Request) (interface{}, *models.APIError)
}

Custom handler type for our web app. Provides a models.AppContext struct which allows the handler to interact with the state of the application.

type ExchangeTokenHandler

type ExchangeTokenHandler struct{}

func (ExchangeTokenHandler) Serve

func (h ExchangeTokenHandler) Serve(ctx *models.AppContext, r *http.Request) (interface{}, *models.APIError)

Exchange users Google Id Token for a Squad Up API token, essentially the "login" endpoint.

type HandlerLoader

type HandlerLoader interface {
	Load()
}

HandlerLoader interface provides methods useful for loading large numbers of http handlers

type Loader

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

Loader is a data structure for this file's HandlerLoader implementation.

func NewLoader

func NewLoader(mux *http.ServeMux, ctx *models.AppContext) Loader

func (Loader) Ctx

func (l Loader) Ctx() *models.AppContext

func (Loader) Load

func (l Loader) Load()

Jump to

Keyboard shortcuts

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