options

package
v0.15.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomHandler

type CustomHandler interface {
	// Route is the custom handler route.
	Route() string
	// Methods is the list of http methods this handler services.
	Methods() []string
	// Handler is the custom handler itself.
	Handler(handlerOptions HandlerOptions) (http.Handler, error)
}

CustomHandler allows for custom third party http handlers.

type HandlerOptions

type HandlerOptions interface {
	// CreatedAt returns the time the options were created.
	CreatedAt() time.Time

	// Storage returns the set storage.
	Storage() storage.Storage
	// SetStorage sets the set storage.
	SetStorage(s storage.Storage) HandlerOptions

	// DownsamplerAndWriter returns the set downsampler and writer.
	DownsamplerAndWriter() ingest.DownsamplerAndWriter
	// SetDownsamplerAndWriter sets the set downsampler and writer.
	SetDownsamplerAndWriter(d ingest.DownsamplerAndWriter) HandlerOptions

	// Engine returns the engine.
	Engine() executor.Engine
	// SetEngine sets the engine.
	SetEngine(e executor.Engine) HandlerOptions

	// Clusters returns the clusters.
	Clusters() m3.Clusters
	// SetClusters sets the clusters.
	SetClusters(c m3.Clusters) HandlerOptions

	// ClusterClient returns the cluster client.
	ClusterClient() clusterclient.Client
	// SetClusterClient sets the cluster client.
	SetClusterClient(c clusterclient.Client) HandlerOptions

	// Config returns the config.
	Config() config.Configuration
	// SetConfig sets the config.
	SetConfig(c config.Configuration) HandlerOptions

	// EmbeddedDbCfg returns the embedded db config.
	EmbeddedDbCfg() *dbconfig.DBConfiguration
	// SetEmbeddedDbCfg sets the embedded db config.
	SetEmbeddedDbCfg(c *dbconfig.DBConfiguration) HandlerOptions

	// TagOptions returns the tag options.
	TagOptions() models.TagOptions
	// SetTagOptions sets the tag options.
	SetTagOptions(opts models.TagOptions) HandlerOptions

	// TimeoutOpts returns the timeout options.
	TimeoutOpts() *prometheus.TimeoutOpts
	// SetTimeoutOpts sets the timeout options.
	SetTimeoutOpts(t *prometheus.TimeoutOpts) HandlerOptions

	// Enforcer returns the enforcer.
	Enforcer() cost.ChainedEnforcer
	// SetEnforcer sets the enforcer.
	SetEnforcer(e cost.ChainedEnforcer) HandlerOptions

	// FetchOptionsBuilder returns the fetch options builder.
	FetchOptionsBuilder() handleroptions.FetchOptionsBuilder
	// SetFetchOptionsBuilder sets the fetch options builder.
	SetFetchOptionsBuilder(b handleroptions.FetchOptionsBuilder) HandlerOptions

	// QueryContextOptions returns the query context options.
	QueryContextOptions() models.QueryContextOptions
	// SetQueryContextOptions sets the query context options.
	SetQueryContextOptions(o models.QueryContextOptions) HandlerOptions

	// CPUProfileDuration returns the cpu profile duration.
	CPUProfileDuration() time.Duration
	// SetCPUProfileDuration sets the cpu profile duration.
	SetCPUProfileDuration(c time.Duration) HandlerOptions

	// PlacementServiceNames returns the placement service names.
	PlacementServiceNames() []string
	// SetPlacementServiceNames sets the placement service names.
	SetPlacementServiceNames(n []string) HandlerOptions

	// ServiceOptionDefaults returns the service option defaults.
	ServiceOptionDefaults() []handleroptions.ServiceOptionsDefault
	// SetServiceOptionDefaults sets the service option defaults.
	SetServiceOptionDefaults(s []handleroptions.ServiceOptionsDefault) HandlerOptions

	// NowFn returns the now function.
	NowFn() clock.NowFn
	// SetNowFn sets the now function.
	SetNowFn(f clock.NowFn) HandlerOptions

	// InstrumentOpts returns the instrumentation optoins.
	InstrumentOpts() instrument.Options
	// SetInstrumentOpts sets instrumentation options.
	SetInstrumentOpts(opts instrument.Options) HandlerOptions
}

HandlerOptions represents handler options.

func EmptyHandlerOptions

func EmptyHandlerOptions() HandlerOptions

EmptyHandlerOptions returns default handler options.

func NewHandlerOptions

func NewHandlerOptions(
	downsamplerAndWriter ingest.DownsamplerAndWriter,
	tagOptions models.TagOptions,
	engine executor.Engine,
	m3dbClusters m3.Clusters,
	clusterClient clusterclient.Client,
	cfg config.Configuration,
	embeddedDbCfg *dbconfig.DBConfiguration,
	enforcer cost.ChainedEnforcer,
	fetchOptionsBuilder handleroptions.FetchOptionsBuilder,
	queryContextOptions models.QueryContextOptions,
	instrumentOpts instrument.Options,
	cpuProfileDuration time.Duration,
	placementServiceNames []string,
	serviceOptionDefaults []handleroptions.ServiceOptionsDefault,
) (HandlerOptions, error)

NewHandlerOptions builds a handler options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL