testhelpers

package
v2.0.0-alpha8+incompat... Latest Latest
Warning

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

Go to latest
Published: Jul 1, 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(*config.HTTPConfiguration)) *config.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 *config.BasicAuth) func(*config.Middleware)

WithBasicAuth is a helper to create a configuration.

func WithEntryPoints

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

WithEntryPoints is a helper to create a configuration.

func WithLoadBalancerServices

func WithLoadBalancerServices(opts ...func(service *config.LoadBalancerService) string) func(*config.HTTPConfiguration)

WithLoadBalancerServices is a helper to create a configuration.

func WithMiddleware

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

WithMiddleware is a helper to create a configuration.

func WithMiddlewares

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

WithMiddlewares is a helper to create a configuration.

func WithRouter

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

WithRouter is a helper to create a configuration.

func WithRouterMiddlewares

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

WithRouterMiddlewares is a helper to create a configuration.

func WithRouters

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

WithRouters is a helper to create a configuration.

func WithRule

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

WithRule is a helper to create a configuration.

func WithServer

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

WithServer is a helper to create a configuration.

func WithServers

func WithServers(opts ...func(*config.Server)) func(*config.LoadBalancerService)

WithServers is a helper to create a configuration.

func WithService

func WithService(name string, opts ...func(*config.LoadBalancerService)) func(*config.LoadBalancerService) string

WithService is a helper to create a configuration.

func WithServiceName

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

WithServiceName is a helper to create a configuration.

func WithStickiness

func WithStickiness(cookieName string) func(*config.LoadBalancerService)

WithStickiness 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