legacy

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultChunkSize = 10000

DefaultChunkSize is the default number of points to write in one chunk.

Variables

This section is empty.

Functions

func NewRouter

NewRouter returns a new router with a 404 handler, a 405 handler, and a panic handler.

Types

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, c influxdb.CredentialsV1) (*influxdb.Authorization, error)
}

type Backend

type Backend struct {
	errors.HTTPErrorHandler
	Logger            *zap.Logger
	MaxBatchSizeBytes int64

	WriteEventRecorder    metric.EventRecorder
	AuthorizationService  influxdb.AuthorizationService
	OrganizationService   influxdb.OrganizationService
	BucketService         influxdb.BucketService
	PointsWriter          storage.PointsWriter
	DBRPMappingService    influxdb.DBRPMappingService
	InfluxqldQueryService influxql.ProxyQueryService
}

type Handler

type Handler struct {
	errors.HTTPErrorHandler
	PointsWriterHandler *WriteHandler
	PingHandler         *PingHandler
	InfluxQLHandler     *InfluxqlHandler
}

Handler is a collection of all the service handlers.

func (*Handler) PrometheusCollectors

func (h *Handler) PrometheusCollectors() []prometheus.Collector

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http2.ResponseWriter, r *http2.Request)

type HandlerConfig

type HandlerConfig struct {
	DefaultRoutingKey string
}

HandlerConfig provides configuration for the legacy handler.

func NewHandlerConfig

func NewHandlerConfig() *HandlerConfig

func (*HandlerConfig) Opts

func (c *HandlerConfig) Opts() []cli.Opt

Opts returns the CLI options for use with kit/cli. Currently set values on c are provided as the defaults.

type Influx1xAuthenticationHandler

type Influx1xAuthenticationHandler struct {
	errors2.HTTPErrorHandler
	// contains filtered or unexported fields
}

func NewInflux1xAuthenticationHandler

func NewInflux1xAuthenticationHandler(next http.Handler, auth Authorizer, h errors2.HTTPErrorHandler) *Influx1xAuthenticationHandler

NewInflux1xAuthenticationHandler creates an authentication handler to process InfluxDB 1.x authentication requests.

func (*Influx1xAuthenticationHandler) ServeHTTP

ServeHTTP extracts the session or token from the http request and places the resulting authorizer on the request context.

type InfluxQLBackend

type InfluxQLBackend struct {
	errors.HTTPErrorHandler
	Logger                *zap.Logger
	AuthorizationService  platform.AuthorizationService
	OrganizationService   platform.OrganizationService
	ProxyQueryService     query.ProxyQueryService
	InfluxqldQueryService influxqld.ProxyQueryService
}

func NewInfluxQLBackend

func NewInfluxQLBackend(b *Backend) *InfluxQLBackend

NewInfluxQLBackend constructs an InfluxQLBackend from a LegacyBackend.

type InfluxqlHandler

type InfluxqlHandler struct {
	*InfluxQLBackend
	HandlerConfig
	Metrics *control.ControllerMetrics
}

InfluxqlHandler mimics the /query handler from influxdb, but, enriches with org and forwards requests to the transpiler service.

func NewInfluxQLHandler

func NewInfluxQLHandler(b *InfluxQLBackend, config HandlerConfig) *InfluxqlHandler

NewInfluxQLHandler returns a new instance of InfluxqlHandler to handle influxql v1 queries

func (*InfluxqlHandler) PrometheusCollectors

func (h *InfluxqlHandler) PrometheusCollectors() []prometheus.Collector

func (*InfluxqlHandler) ServeHTTP

func (h *InfluxqlHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PingHandler

type PingHandler struct {
	*httprouter.Router
}

func NewPingHandler

func NewPingHandler() *PingHandler

type PointsWriterBackend

type PointsWriterBackend struct {
	errors.HTTPErrorHandler
	Logger *zap.Logger

	EventRecorder      metric.EventRecorder
	BucketService      influxdb.BucketService
	PointsWriter       storage.PointsWriter
	DBRPMappingService influxdb.DBRPMappingService
}

PointsWriterBackend contains all the services needed to run a PointsWriterHandler.

func NewPointsWriterBackend

func NewPointsWriterBackend(b *Backend) *PointsWriterBackend

NewPointsWriterBackend creates a new backend for legacy work.

type WriteHandler

type WriteHandler struct {
	errors.HTTPErrorHandler
	EventRecorder      metric.EventRecorder
	BucketService      influxdb.BucketService
	PointsWriter       storage.PointsWriter
	DBRPMappingService influxdb.DBRPMappingService
	// contains filtered or unexported fields
}

PointsWriterHandler represents an HTTP API handler for writing points.

func NewWriterHandler

func NewWriterHandler(b *PointsWriterBackend, opts ...WriteHandlerOption) *WriteHandler

NewWriterHandler returns a new instance of PointsWriterHandler.

func (*WriteHandler) ServeHTTP

func (h *WriteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

type WriteHandlerOption

type WriteHandlerOption func(*WriteHandler)

WriteHandlerOption is a functional option for a *PointsWriterHandler

func WithMaxBatchSizeBytes

func WithMaxBatchSizeBytes(n int64) WriteHandlerOption

WithMaxBatchSizeBytes configures the maximum size for a (decompressed) points batch allowed by the write handler

Jump to

Keyboard shortcuts

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