Documentation
¶
Overview ¶
Package backends the interface and generic functionality for Backend providers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface {
// RegisterHandlers registers the provided Handlers into the Router
RegisterHandlers(handlers.Lookup)
// Handlers returns a map of the HTTP Handlers the Backend has registered
Handlers() handlers.Lookup
// DefaultPathConfigs returns the default PathConfigs for the given Provider
DefaultPathConfigs(*bo.Options) po.List
// Configuration returns the configuration for the Backend
Configuration() *bo.Options
// Name returns the name of the Backend
Name() string
// HTTPClient will return the HTTP Client for this Backend
HTTPClient() *http.Client
// SetCache sets the Cache object the Backend will use when caching origin content
SetCache(cache.Cache)
// Router returns a Router that handles HTTP Requests for this Backend
Router() http.Handler
// Cache returns a handle to the Cache instance used by the Backend
Cache() cache.Cache
// BaseUpstreamURL returns the base URL for upstream requests
BaseUpstreamURL() *url.URL
// SetHealthCheckProbe sets the Health Check Status Prober for the Client
SetHealthCheckProbe(healthcheck.DemandProbe)
// HealthHandler executes a Health Check Probe when called
HealthHandler(http.ResponseWriter, *http.Request)
// DefaultHealthCheckConfig returns the default Health Check Config for the given Provider
DefaultHealthCheckConfig() *ho.Options
// HealthCheckHTTPClient returns the HTTP Client used for Health Checking
HealthCheckHTTPClient() *http.Client
}
Backend is the primary interface for interoperating with backends
type Backends ¶
Backends represents a map of Backends keyed by Name
func (Backends) StartHealthChecks ¶
func (b Backends) StartHealthChecks(knownStatuses healthcheck.StatusLookup) (healthcheck.HealthChecker, error)
StartHealthChecks iterates the backends to fully configure health checkers and start up any intervaled health checks. knownStatuses is optional and sets the initial status of the provided targets (e.g., after a config reload)
type MergeableTimeseriesBackend ¶
type MergeableTimeseriesBackend interface {
// MergePaths should return a slice of HTTP Paths that are safe to merge with
// other requests of the same path (e.g., /api/v1/query_range in prometheus)
MergeablePaths() []string
}
MergeableTimeseriesBackend defines the interface for mergeable time series
type TimeseriesBackend ¶
type TimeseriesBackend interface {
// RegisterHandlers registers the provided Handlers into the Router
RegisterHandlers(handlers.Lookup)
// Handlers returns a map of the HTTP Handlers the Backend has registered
Handlers() handlers.Lookup
// DefaultPathConfigs returns the default PathConfigs for the given Provider
DefaultPathConfigs(*bo.Options) po.List
// ParseTimeRangeQuery returns a timeseries.TimeRangeQuery based on the provided HTTP Request
ParseTimeRangeQuery(*http.Request) (*timeseries.TimeRangeQuery, *timeseries.RequestOptions, bool, error)
// Configuration returns the configuration for the Backend
Configuration() *bo.Options
// Name returns the name of the Backend
Name() string
// FastForwardRequest returns an *http.Request crafted to collect Fast Forward data
// from the Origin, based on the provided HTTP Request. If the inbound request is
// POST/PUT/PATCH, a Content-Type header and non-nil body with the query parameters
// must be set, in lieu of updated url query values, in the returned request
FastForwardRequest(*http.Request) (*http.Request, error)
// SetExtent will update an upstream request's timerange
// parameters based on the provided timeseries.Extent
SetExtent(*http.Request, *timeseries.TimeRangeQuery, *timeseries.Extent)
// HTTPClient will return the HTTP Client for this Backend
HTTPClient() *http.Client
// SetCache sets the Cache object the Backend will use when caching origin content
SetCache(cache.Cache)
// Cache returns a handle to the Cache object used by the Backend
Cache() cache.Cache
// Router returns a Router that handles HTTP Requests for this Backend
Router() http.Handler
// BaseUpstreamURL returns the base URL for upstream requests
BaseUpstreamURL() *url.URL
// Modeler returns the Modeler for converting between DataSets and wire documents
Modeler() *timeseries.Modeler
// DefaultHealthCheckConfig returns the default HealthCHeck Config for the given Provider
DefaultHealthCheckConfig() *ho.Options
// SetHealthCheckProbe sets the Health Check Status Prober for the Client
SetHealthCheckProbe(healthcheck.DemandProbe)
// HealthHandler executes a Health Check Probe when called
HealthHandler(http.ResponseWriter, *http.Request)
// HealthCheckHTTPClient returns the HTTP Client used for Health Checking
HealthCheckHTTPClient() *http.Client
// ProcessTransformations executes any provider-specific transformations, like injecting
// labels into the dataset
ProcessTransformations(timeseries.Timeseries)
}
TimeseriesBackend is the primary interface for interoperating with Trickster and upstream TSDB's
func NewTimeseriesBackend ¶
func NewTimeseriesBackend(name string, o *bo.Options, registrar Registrar, router http.Handler, cache cache.Cache, modeler *timeseries.Modeler, ) (TimeseriesBackend, error)
NewTimeseriesBackend returns a new BaseTimeseriesBackend Instance
Directories
¶
| Path | Synopsis |
|---|---|
|
Package alb implements the Application Load Balancer Backend
|
Package alb implements the Application Load Balancer Backend |
|
mech
Package mech provides the ALB Mechanisms functionality
|
Package mech provides the ALB Mechanisms functionality |
|
pool
Package pool provides an application load balancer pool
|
Package pool provides an application load balancer pool |
|
Package clickhouse provides the ClickHouse backend provider
|
Package clickhouse provides the ClickHouse backend provider |
|
authenticator
Package authenticator provides an Authenticator implementation for ClickHouse.
|
Package authenticator provides an Authenticator implementation for ClickHouse. |
|
Package influxdb provides the InfluxDB Backend provider
|
Package influxdb provides the InfluxDB Backend provider |
|
iofmt
package iofmt assists with managing supported input and output formats across the various versions of InfluxDB
|
package iofmt assists with managing supported input and output formats across the various versions of InfluxDB |
|
Package prometheus provides the Prometheus Backend provider
|
Package prometheus provides the Prometheus Backend provider |
|
Package reverseproxy provides the HTTP Reverse Proxy (no caching) Backend provider
|
Package reverseproxy provides the HTTP Reverse Proxy (no caching) Backend provider |
|
Package reverseproxycache provides the HTTP Reverse Proxy Cache Backend provider
|
Package reverseproxycache provides the HTTP Reverse Proxy Cache Backend provider |
|
Package tree provides data structures that define the possible paths through chained Backends to assist with config Validation
|
Package tree provides data structures that define the possible paths through chained Backends to assist with config Validation |