testhelpers

package
v2.0.0-...-63d56cd Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfiguration

func BuildConfiguration(dynamicConfigBuilders ...func(*dynamic.HTTPConfiguration)) *dynamic.HTTPConfiguration

BuildConfiguration is a helper to create a configuration.

func MustNewRequest

func MustNewRequest(method, urlStr string, body io.Reader) *http.Request

MustNewRequest creates a new http get request or panics if it can't

func MustParseURL

func MustParseURL(rawURL string) *url.URL

MustParseURL parses a URL or panics if it can't

func WithBasicAuth

func WithBasicAuth(auth *dynamic.BasicAuth) func(*dynamic.Middleware)

WithBasicAuth is a helper to create a configuration.

func WithEntryPoints

func WithEntryPoints(eps ...string) func(*dynamic.Router)

WithEntryPoints is a helper to create a configuration.

func WithLoadBalancerServices

func WithLoadBalancerServices(opts ...func(service *dynamic.ServersLoadBalancer) string) func(*dynamic.HTTPConfiguration)

WithLoadBalancerServices is a helper to create a configuration.

func WithMiddleware

func WithMiddleware(name string, opts ...func(*dynamic.Middleware)) func(*dynamic.Middleware) string

WithMiddleware is a helper to create a configuration.

func WithMiddlewares

func WithMiddlewares(opts ...func(*dynamic.Middleware) string) func(*dynamic.HTTPConfiguration)

WithMiddlewares is a helper to create a configuration.

func WithRouter

func WithRouter(routerName string, opts ...func(*dynamic.Router)) func(*dynamic.Router) string

WithRouter is a helper to create a configuration.

func WithRouterMiddlewares

func WithRouterMiddlewares(middlewaresName ...string) func(*dynamic.Router)

WithRouterMiddlewares is a helper to create a configuration.

func WithRouters

func WithRouters(opts ...func(*dynamic.Router) string) func(*dynamic.HTTPConfiguration)

WithRouters is a helper to create a configuration.

func WithRule

func WithRule(rule string) func(*dynamic.Router)

WithRule is a helper to create a configuration.

func WithServer

func WithServer(url string, opts ...func(*dynamic.Server)) func(*dynamic.Server)

WithServer is a helper to create a configuration.

func WithServers

func WithServers(opts ...func(*dynamic.Server)) func(*dynamic.ServersLoadBalancer)

WithServers is a helper to create a configuration.

func WithService

func WithService(name string, opts ...func(*dynamic.ServersLoadBalancer)) func(*dynamic.ServersLoadBalancer) string

WithService is a helper to create a configuration.

func WithServiceName

func WithServiceName(serviceName string) func(*dynamic.Router)

WithServiceName is a helper to create a configuration.

func WithSticky

func WithSticky(cookieName string) func(*dynamic.ServersLoadBalancer)

WithSticky is a helper to create a configuration.

Types

type CollectingCounter

type CollectingCounter struct {
	CounterValue    float64
	LastLabelValues []string
}

CollectingCounter is a metrics.Counter implementation that enables access to the CounterValue and LastLabelValues.

func (*CollectingCounter) Add

func (c *CollectingCounter) Add(delta float64)

Add is there to satisfy the metrics.Counter interface.

func (*CollectingCounter) With

func (c *CollectingCounter) With(labelValues ...string) metrics.Counter

With is there to satisfy the metrics.Counter interface.

type CollectingGauge

type CollectingGauge struct {
	GaugeValue      float64
	LastLabelValues []string
}

CollectingGauge is a metrics.Gauge implementation that enables access to the GaugeValue and LastLabelValues.

func (*CollectingGauge) Add

func (g *CollectingGauge) Add(delta float64)

Add is there to satisfy the metrics.Gauge interface.

func (*CollectingGauge) Set

func (g *CollectingGauge) Set(value float64)

Set is there to satisfy the metrics.Gauge interface.

func (*CollectingGauge) With

func (g *CollectingGauge) With(labelValues ...string) metrics.Gauge

With is there to satisfy the metrics.Gauge interface.

type CollectingHealthCheckMetrics

type CollectingHealthCheckMetrics struct {
	Gauge *CollectingGauge
}

CollectingHealthCheckMetrics can be used for testing the Metrics instrumentation of the HealthCheck package.

func NewCollectingHealthCheckMetrics

func NewCollectingHealthCheckMetrics() *CollectingHealthCheckMetrics

NewCollectingHealthCheckMetrics creates a new CollectingHealthCheckMetrics instance.

func (*CollectingHealthCheckMetrics) BackendServerUpGauge

func (m *CollectingHealthCheckMetrics) BackendServerUpGauge() metrics.Gauge

BackendServerUpGauge is there to satisfy the healthcheck.metricsRegistry interface.

Jump to

Keyboard shortcuts

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