httpserver

package
v1.0.539-11f746b Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

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

func New

func New(ctx context.Context, name, addr string, handler http.Handler) (s *HTTPServer, err error)

func (HTTPServer) Addr

func (s HTTPServer) Addr() string

func (*HTTPServer) MetricsProducer

func (s *HTTPServer) MetricsProducer() MetricProducer

func (*HTTPServer) Serve

func (s *HTTPServer) Serve(ctx context.Context) error

Serve the http server. On context cancellation the server is shutdown giving some time for the in flight requests to be handled.

type MetricProducer

type MetricProducer interface {
	// MetricName The name for this group of metrics
	//(Name might be cleaner, but is much more likely to conflict in implementations)
	MetricName() string
	// Gauges are instantaneous name value pairs
	Gauges(context.Context) map[string]float64
}

Jump to

Keyboard shortcuts

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