apiserver

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = NewError(http.StatusUnauthorized, "auth.token.is_not_valid")
	ErrTokenRevoked = NewError(http.StatusUnauthorized, "auth.token.revoked")
	ErrUnhealthy    = NewError(http.StatusInternalServerError, "system.unhealthy")
)

Functions

func Start

func Start(addr string, store store.Store, publisher eventapi.Publisher) error

Start begins listening for requests.

Types

type Error added in v0.0.10

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func NewError added in v0.0.10

func NewError(code int, message string) Error

func (Error) Error added in v0.0.10

func (e Error) Error() string

type Handler added in v0.0.10

type Handler func(w http.ResponseWriter, r *http.Request) error

The Handler helps to handle errors in one place.

func (Handler) ServeHTTP added in v0.0.10

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP allows our Handler type to satisfy http.Handler.

Jump to

Keyboard shortcuts

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