Documentation ¶
Overview ¶
Package wares is a collection of bear.HandlerFunc middleware generators for use with a forest.App instance.
Index ¶
- func Authenticate(app *forest.App) func(ctx *bear.Context)
- func BodyParser(app *forest.App) func(ctx *bear.Context)
- func CSRF(app *forest.App) func(ctx *bear.Context)
- func ErrorsBadRequest(app *forest.App) func(ctx *bear.Context)
- func ErrorsConflict(app *forest.App) func(ctx *bear.Context)
- func ErrorsMethodNotAllowed(app *forest.App) func(ctx *bear.Context)
- func ErrorsNotFound(app *forest.App) func(ctx *bear.Context)
- func ErrorsServerError(app *forest.App) func(ctx *bear.Context)
- func ErrorsUnauthorized(app *forest.App) func(ctx *bear.Context)
- func InstallBodyParser(app *forest.App)
- func InstallErrorWares(app *forest.App)
- func InstallSecurityWares(app *forest.App)
- func InstallSessionWares(app *forest.App, manager SessionManager)
- func SessionDel(app *forest.App, manager SessionManager) func(ctx *bear.Context)
- func SessionGet(app *forest.App, manager SessionManager) func(ctx *bear.Context)
- func SessionSet(app *forest.App, manager SessionManager) func(ctx *bear.Context)
- type Populater
- type SessionManager
- type Ware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallBodyParser ¶
func InstallErrorWares ¶
func InstallSecurityWares ¶
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 }
Click to show internal directories.
Click to hide internal directories.