testhelpers

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 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

func BuildConfiguration

func BuildConfiguration(dynamicConfigBuilders ...func(*types.Configuration)) *types.Configuration

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 WithBackendNew

func WithBackendNew(name string, opts ...func(*types.Backend)) func(*types.Backend) string

WithBackendNew is a helper to create a configuration

func WithBackends

func WithBackends(opts ...func(*types.Backend) string) func(*types.Configuration)

WithBackends is a helper to create a configuration

func WithEntryPoints

func WithEntryPoints(eps ...string) func(*types.Frontend)

WithEntryPoints is a helper to create a configuration

func WithFrontend

func WithFrontend(backend string, opts ...func(*types.Frontend)) func(*types.Frontend) string

WithFrontend is a helper to create a configuration

func WithFrontends

func WithFrontends(opts ...func(*types.Frontend) string) func(*types.Configuration)

WithFrontends is a helper to create a configuration

func WithLBMethod

func WithLBMethod(method string) func(*types.Backend)

WithLBMethod is a helper to create a configuration

func WithLBSticky

func WithLBSticky(cookieName string) func(*types.Backend)

WithLBSticky is a helper to create a configuration

func WithRoute

func WithRoute(name string, rule string) func(*types.Route) string

WithRoute is a helper to create a configuration

func WithRoutes

func WithRoutes(opts ...func(*types.Route) string) func(*types.Frontend)

WithRoutes is a helper to create a configuration

func WithServerNew

func WithServerNew(url string, opts ...func(*types.Server)) func(*types.Server) string

WithServerNew is a helper to create a configuration

func WithServersNew

func WithServersNew(opts ...func(*types.Server) string) func(*types.Backend)

WithServersNew 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