middleware

package
v0.0.0-...-14179a4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2015 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cors

type Cors struct {
	AllowedOrigins   []string `json:"allowed_origins"`
	AllowedMethods   []string `json:"allowed_methods"`
	AllowedHeaders   []string `json:"allowed_headers"`
	ExposedHeaders   []string `json:"exposed_headers"`
	AllowCredentials bool     `json:"allow_credentials"`
	MaxAge           int      `json:"max_age"`
	Debug            bool     `json:"debug"`
}

func (*Cors) Configure

func (c *Cors) Configure(cfg string)

func (*Cors) ProcessRequest

func (c *Cors) ProcessRequest(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

type Middleware

type Middleware interface {
	Configure(cfg string)
	ProcessRequest(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
}

Middleware which modify the request.

func NewCorsMiddleware

func NewCorsMiddleware() Middleware

type Middlewares

type Middlewares map[string]func() Middleware

An array of Middleware with key to be used by the gateway and service.

func (Middlewares) Add

func (f Middlewares) Add(key string, value func() Middleware)

func (Middlewares) Get

func (f Middlewares) Get(key string) func() Middleware

type RequestIdMiddleware

type RequestIdMiddleware struct{}

func NewRequestIdMiddleware

func NewRequestIdMiddleware() *RequestIdMiddleware

func (*RequestIdMiddleware) ServeHTTP

func (rid *RequestIdMiddleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

Jump to

Keyboard shortcuts

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