middleware

package
v0.0.0-...-9044698 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package middleware - infrastructure/middleware

Package middleware - infrastructure/middleware

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	ErrorMessages map[int]map[string]string
	Context       func(r *http.Request, authenticatedKey string)
	Debug         bool
	Client        func(key, secret string) bool
}

AuthConfig config for the middleware

type CsrfMiddleware

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

CsrfMiddleware struct

func NewCsrfMiddleware

func NewCsrfMiddleware(name string) *CsrfMiddleware

NewCsrfMiddleware constructor

func (*CsrfMiddleware) ServeHTTP

func (m *CsrfMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

ServeHTTP mandatory middleware part

type RESTGate

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

RESTGate middleware

func NewAuthMiddleware

func NewAuthMiddleware(headerKeyLabel string, headerSecretLabel string, config AuthConfig) *RESTGate

NewAuthMiddleware new Auth Middleware

func (*RESTGate) ServeHTTP

func (rest *RESTGate) ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)

type Session

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

Session struct

func NewSession

func NewSession(session sessions.Store) *Session

NewSession creates new session

func (*Session) ServeHTTP

func (a *Session) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

ServeHTTP mandatory middleware part

type UserMiddleware

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

UserMiddleware struct

func NewUserMiddleware

func NewUserMiddleware(c *UserMiddlewareConfig) *UserMiddleware

NewUserMiddleware constructor

func (*UserMiddleware) ServeHTTP

func (m *UserMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

ServeHTTP mandatory middleware part

type UserMiddlewareConfig

type UserMiddlewareConfig struct {
	Authenticator func(userId string) (interface{}, error)
}

UserMiddlewareConfig config for UserMiddleware

Jump to

Keyboard shortcuts

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