api

package
v0.0.0-...-df8e353 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackendsIndex = func(backends domain.Backends) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
		backendsJSON, err := json.Marshal(backends.AsJSON())
		if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}

		_, err = w.Write(backendsJSON)
		if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}
	})
}

Functions

func NewHandler

func NewHandler(backends domain.Backends, logger lager.Logger, apiConfig config.API) http.Handler

Types

type Runner

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

func NewRunner

func NewRunner(port uint, handler http.Handler, logger lager.Logger) Runner

func (Runner) Run

func (a Runner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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