wares

package module
v0.0.0-...-ebd2c23 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2016 License: MIT Imports: 10 Imported by: 0

README

forest-wares

Coverage Status

API documentation

forest-wares is a package that contains bear.HandlerFunc (middleware) generating functions and installers for use with forest.App instances.

Install

go get github.com/ursiform/forest-wares

Test

go test -cover github.com/ursiform/forest-wares

API

API documentation

License

MIT License

Documentation

Overview

Package wares is a collection of bear.HandlerFunc middleware generators for use with a forest.App instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(app *forest.App) func(ctx *bear.Context)

func BodyParser

func BodyParser(app *forest.App) func(ctx *bear.Context)

func CSRF

func CSRF(app *forest.App) func(ctx *bear.Context)

func ErrorsBadRequest

func ErrorsBadRequest(app *forest.App) func(ctx *bear.Context)

func ErrorsConflict

func ErrorsConflict(app *forest.App) func(ctx *bear.Context)

func ErrorsMethodNotAllowed

func ErrorsMethodNotAllowed(app *forest.App) func(ctx *bear.Context)

func ErrorsNotFound

func ErrorsNotFound(app *forest.App) func(ctx *bear.Context)

func ErrorsServerError

func ErrorsServerError(app *forest.App) func(ctx *bear.Context)

func ErrorsUnauthorized

func ErrorsUnauthorized(app *forest.App) func(ctx *bear.Context)

func InstallBodyParser

func InstallBodyParser(app *forest.App)

func InstallErrorWares

func InstallErrorWares(app *forest.App)

func InstallSecurityWares

func InstallSecurityWares(app *forest.App)

func InstallSessionWares

func InstallSessionWares(app *forest.App, manager SessionManager)

func SessionDel

func SessionDel(app *forest.App, manager SessionManager) func(ctx *bear.Context)

func SessionGet

func SessionGet(app *forest.App, manager SessionManager) func(ctx *bear.Context)

func SessionSet

func SessionSet(app *forest.App, manager SessionManager) func(ctx *bear.Context)

Types

type Populater

type Populater interface {
	Populate(body io.ReadCloser) error
}

type SessionManager

type SessionManager interface {
	Create(
		sessionID string,
		userID string,
		userJSON string,
		ctx *bear.Context) error
	CreateEmpty(sessionID string, ctx *bear.Context)
	Delete(sessionID string, userID string) error
	Marshal(ctx *bear.Context) ([]byte, error)
	Read(sessionID string) (userID string, userJSON string, err error)
	Revoke(userID string) error
	Update(
		sessionID string,
		userID string,
		userJSON string,
		duration time.Duration) error
}

type Ware

type Ware func(ctx *bear.Context)

Jump to

Keyboard shortcuts

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