http

package
v0.0.0-...-f12b9c8 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricsMiddleware

func NewMetricsMiddleware(registerer prometheus.Registerer) *metricsMiddleware

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option overrides behavior of Server.

func WithGracePeriod

func WithGracePeriod(t time.Duration) Option

WithGracePeriod sets shutdown grace period for HTTP server. Server waits connections to drain for specified amount of time.

func WithListen

func WithListen(s string) Option

WithListen sets address to listen for HTTP server. Server accepts incoming TCP connections on given address.

type Server

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

func New

func New(
	limiter *limiter.LimiterService,
	logger *logrus.Logger,
	metricsRegistry *prometheus.Registry,
	opts ...Option) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop(err error)

Jump to

Keyboard shortcuts

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