testhelpers

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfiguration added in v1.6.3

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 added in v1.4.0

func MustParseURL(rawURL string) *url.URL

MustParseURL parses a URL or panics if it can't

func WithBackendNew added in v1.6.3

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

WithBackendNew is a helper to create a configuration

func WithBackends added in v1.6.3

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

WithBackends is a helper to create a configuration

func WithBasicAuth added in v1.7.0

func WithBasicAuth(username string, password string) func(*types.Frontend)

WithBasicAuth is a helper to create a configuration Deprecated

func WithEntryPoints added in v1.6.3

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

WithEntryPoints is a helper to create a configuration

func WithFrontEndAuth added in v1.7.0

func WithFrontEndAuth(auth *types.Auth) func(*types.Frontend)

WithFrontEndAuth is a helper to create a configuration

func WithFrontend added in v1.6.3

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

WithFrontend is a helper to create a configuration

func WithFrontendName added in v1.7.0

func WithFrontendName(name string) func(*types.Frontend)

WithFrontendName is a helper to create a configuration

func WithFrontends added in v1.6.3

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

WithFrontends is a helper to create a configuration

func WithLBMethod added in v1.6.3

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

WithLBMethod is a helper to create a configuration

func WithLBSticky added in v1.6.3

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

WithLBSticky is a helper to create a configuration

func WithRoute added in v1.6.3

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

WithRoute is a helper to create a configuration

func WithRoutes added in v1.6.3

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

WithRoutes is a helper to create a configuration

func WithServerNew added in v1.6.3

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

WithServerNew is a helper to create a configuration

func WithServersNew added in v1.6.3

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

WithServersNew is a helper to create a configuration

Types

type CollectingCounter added in v1.6.0

type CollectingCounter struct {
	CounterValue    float64
	LastLabelValues []string
}

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

func (*CollectingCounter) Add added in v1.6.0

func (c *CollectingCounter) Add(delta float64)

Add is there to satisfy the metrics.Counter interface.

func (*CollectingCounter) With added in v1.6.0

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

With is there to satisfy the metrics.Counter interface.

type CollectingGauge added in v1.6.0

type CollectingGauge struct {
	GaugeValue      float64
	LastLabelValues []string
}

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

func (*CollectingGauge) Add added in v1.6.0

func (g *CollectingGauge) Add(delta float64)

Add is there to satisfy the metrics.Gauge interface.

func (*CollectingGauge) Set added in v1.6.0

func (g *CollectingGauge) Set(value float64)

Set is there to satisfy the metrics.Gauge interface.

func (*CollectingGauge) With added in v1.6.0

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

With is there to satisfy the metrics.Gauge interface.

type CollectingHealthCheckMetrics added in v1.6.0

type CollectingHealthCheckMetrics struct {
	Gauge *CollectingGauge
}

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

func NewCollectingHealthCheckMetrics added in v1.6.0

func NewCollectingHealthCheckMetrics() *CollectingHealthCheckMetrics

NewCollectingHealthCheckMetrics creates a new CollectingHealthCheckMetrics instance.

func (*CollectingHealthCheckMetrics) BackendServerUpGauge added in v1.6.0

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