testhelpers

package
v0.0.0-...-6ae02c2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 7 Imported by: 0

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 WithBasicAuth

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

WithBasicAuth is a helper to create a configuration Deprecated

func WithEntryPoints

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

WithEntryPoints is a helper to create a configuration

func WithFrontEndAuth

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

WithFrontEndAuth 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 WithFrontendName

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

WithFrontendName 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