middleware

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 7 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

This section is empty.

Types

type LoggedResponseWriter

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

LoggedResponseWriter - wraps http.ResponseWriter. Supports the ability to read a previously recorded response status.

func (*LoggedResponseWriter) Header

func (lrw *LoggedResponseWriter) Header() http.Header

Header returns the result of calling the Header() method of the wrapped http.ResponseWriter.

func (*LoggedResponseWriter) ResponseWriter

func (lrw *LoggedResponseWriter) ResponseWriter() http.ResponseWriter

ResponseWriter returns wrapped ResponseWriter.

func (*LoggedResponseWriter) Status

func (lrw *LoggedResponseWriter) Status() int

Status - returns the previously recorded response status.

func (*LoggedResponseWriter) Write

func (lrw *LoggedResponseWriter) Write(data []byte) (int, error)

Write returns the result of calling the Write() method of the wrapped http.ResponseWriter.

func (*LoggedResponseWriter) WriteHeader

func (lrw *LoggedResponseWriter) WriteHeader(status int)

WriteHeader returns the result of calling the WriteHeader() method of the wrapped http.ResponseWriter

type Statsd added in v0.4.0

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

Statsd is statsd metrics middleware.

func NewStatsd added in v0.4.0

func NewStatsd(logger *logrus.Logger, client *statsd.Client, withLog bool) *Statsd

NewStatsd construct Statsd.

func (*Statsd) RegisterMetrics added in v0.4.0

func (s *Statsd) RegisterMetrics(handler http.Handler) http.Handler

RegisterMetrics send metrics to statsd

type Wrap added in v0.4.0

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

func NewWrap added in v0.4.0

func NewWrap(logger *logrus.Logger) *Wrap

func (*Wrap) Add added in v0.4.0

func (s *Wrap) Add(middleware func(http.Handler) http.Handler)

func (*Wrap) Do added in v0.4.0

func (s *Wrap) Do(handler http.Handler) http.Handler

Source Files

  • responseWriter.go
  • statsd.go
  • wrap.go

Jump to

Keyboard shortcuts

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