middleware

package
v0.0.0-...-665d5c4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRecovery

func NewRecovery(recoverFunc func(w http.ResponseWriter, r *http.Request, err interface{})) func(http.Handler) http.Handler

NewRecovery creates a new instance of Recovery

Types

type HostMatcher

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

HostMatcher is a middleware that matches any host with the given list of hosts. It also supports regex host like *.example.com

func NewHostMatcher

func NewHostMatcher(hosts []string) *HostMatcher

NewHostMatcher creates a new instance of HostMatcher

func (*HostMatcher) Handler

func (h *HostMatcher) Handler(handler http.Handler) http.Handler

Handler is the middleware function

type Logger

type Logger struct{}

Logger struct contains data and logic required for middleware functionality

func NewLogger

func NewLogger() *Logger

NewLogger builds and returns new Logger middleware instance

func (*Logger) Handler

func (m *Logger) Handler(handler http.Handler) http.Handler

Handler implementation

type OpenTracing

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

OpenTracing is a middleware that traces the request latency

func NewOpenTracing

func NewOpenTracing(https bool) *OpenTracing

NewOpenTracing creates a new instance of OpenTracing

func (*OpenTracing) Handler

func (h *OpenTracing) Handler(handler http.Handler) http.Handler

Handler is the middleware function for OpenTracing

type Stats

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

Stats represents the stats middleware

func NewStats

func NewStats(statsClient client.Client) *Stats

NewStats creates a new instance of Stats

func (*Stats) Handler

func (m *Stats) Handler(handler http.Handler) http.Handler

Handler is the middleware function

Jump to

Keyboard shortcuts

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