api

package
v0.0.0-...-acd8c0a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Enabled  bool
	Username []byte
	Password []byte
}

AuthConfig contains all the necessary configuration for basic auth setup.

func (AuthConfig) String

func (a AuthConfig) String() string

StatusString status string for auth config

type Controller

type Controller interface {
	//Register takes a router object and allows the controller to add its routes
	Register(router *httprouter.Router)
}

Controller is the interface all of our controllers must implement.

func NewHealthController

func NewHealthController(startTime time.Time, commit string, roshiURI string) Controller

NewHealthController returns a controller that will display metrics to /metrics

func NewStreamController

func NewStreamController(service service.StreamService, authConfig AuthConfig) Controller

NewStreamController is the exported constructor for a streams controller

type Error

type Error interface {
	error
	Status() int
}

Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.

type StatusError

type StatusError struct {
	Code int
	Err  error
}

StatusError represents an error with an associated HTTP status code.

func (StatusError) Error

func (se StatusError) Error() string

Allows StatusError to satisfy the error interface.

func (StatusError) Status

func (se StatusError) Status() int

Status returns our HTTP status code.

Jump to

Keyboard shortcuts

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