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) 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)
Click to show internal directories.
Click to hide internal directories.