influxdb

package
v0.195.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package influxdb implements the standard library functions for interacting with influxdb. It uses the influxdb dependency from the dependencies/influxdb package to implement the builtins.

Index

Constants

View Source
const (
	BucketsKind       = "buckets"
	BucketsRemoteKind = "influxdata/influxdb.bucketsRemote"
)
View Source
const (
	CardinalityFuncName = "cardinality"
	CardinalityKind     = PackageName + "." + CardinalityFuncName
)
View Source
const (
	DefaultMeasurementColLabel = "_measurement"
	DefaultFieldColLabel       = "_field"
)
View Source
const (
	PackageName    = "influxdata/influxdb"
	FromKind       = "from"
	FromRemoteKind = "influxdata/influxdb.fromRemote"
)
View Source
const ToKind = "to"

ToKind is the kind for the `to` flux function

View Source
const WideToKind = "wide-to"

Variables

This section is empty.

Functions

func NewToTransformation

NewToTransformation returns a new *ToTransformation with the appropriate fields set.

Types

type BucketsOpSpec

type BucketsOpSpec struct {
	Org   *NameOrID
	Host  *string
	Token *string
}

func (*BucketsOpSpec) Kind

func (s *BucketsOpSpec) Kind() flux.OperationKind

type BucketsProcedureSpec

type BucketsProcedureSpec struct {
	plan.DefaultCost

	Org   *NameOrID
	Host  *string
	Token *string
}

func (*BucketsProcedureSpec) Copy

func (*BucketsProcedureSpec) GetHost

func (s *BucketsProcedureSpec) GetHost() *string

func (*BucketsProcedureSpec) GetOrg

func (s *BucketsProcedureSpec) GetOrg() *NameOrID

func (*BucketsProcedureSpec) GetToken

func (s *BucketsProcedureSpec) GetToken() *string

func (*BucketsProcedureSpec) Kind

func (*BucketsProcedureSpec) PostPhysicalValidate

func (s *BucketsProcedureSpec) PostPhysicalValidate(id plan.NodeID) error

func (*BucketsProcedureSpec) SetHost

func (s *BucketsProcedureSpec) SetHost(host *string)

func (*BucketsProcedureSpec) SetOrg

func (s *BucketsProcedureSpec) SetOrg(org *NameOrID)

func (*BucketsProcedureSpec) SetToken

func (s *BucketsProcedureSpec) SetToken(token *string)

type BucketsRemoteProcedureSpec

type BucketsRemoteProcedureSpec struct {
	plan.DefaultCost
	*BucketsProcedureSpec
}

func (*BucketsRemoteProcedureSpec) BuildQuery

func (s *BucketsRemoteProcedureSpec) BuildQuery() *ast.File

func (*BucketsRemoteProcedureSpec) Copy

func (*BucketsRemoteProcedureSpec) Kind

func (*BucketsRemoteProcedureSpec) PostPhysicalValidate

func (s *BucketsRemoteProcedureSpec) PostPhysicalValidate(id plan.NodeID) error

type BucketsRemoteRule

type BucketsRemoteRule struct{}

func (BucketsRemoteRule) Name

func (p BucketsRemoteRule) Name() string

func (BucketsRemoteRule) Pattern

func (p BucketsRemoteRule) Pattern() plan.Pattern

func (BucketsRemoteRule) Rewrite

func (p BucketsRemoteRule) Rewrite(ctx context.Context, node plan.Node) (plan.Node, bool, error)

type CardinalityOpSpec

type CardinalityOpSpec struct {
	influxdb.Config
	Start     flux.Time
	Stop      flux.Time
	Predicate influxdb.Predicate
}

func (*CardinalityOpSpec) Kind

type CardinalityProcedureSpec

type CardinalityProcedureSpec struct {
	plan.DefaultCost
	influxdb.Config
	Bounds       flux.Bounds
	PredicateSet influxdb.PredicateSet
}

func (*CardinalityProcedureSpec) Copy

func (*CardinalityProcedureSpec) Kind

func (*CardinalityProcedureSpec) TimeBounds

func (s *CardinalityProcedureSpec) TimeBounds(predecessorBounds *plan.Bounds) *plan.Bounds

TimeBounds implements plan.BoundsAwareProcedureSpec

type Config

type Config = influxdb.Config

Config contains the common configuration for interacting with an influxdb instance.

type DefaultFromAttributes

type DefaultFromAttributes struct {
	Org   *NameOrID
	Host  *string
	Token *string
}

DefaultFromAttributes is used to inject default attributes for the various from attributes.

This rule is not added by default. Each process must fill out the suitable defaults and add the rule on startup.

func (DefaultFromAttributes) Name

func (d DefaultFromAttributes) Name() string

func (DefaultFromAttributes) Pattern

func (d DefaultFromAttributes) Pattern() plan.Pattern

func (DefaultFromAttributes) Rewrite

type Dependency

type Dependency = influxdb.Dependency

type Field

type Field = influxdb.Field

type FromOpSpec

type FromOpSpec struct {
	Org    *NameOrID
	Bucket NameOrID
	Host   *string
	Token  *string
}

func (*FromOpSpec) Kind

func (s *FromOpSpec) Kind() flux.OperationKind

type FromProcedureSpec

type FromProcedureSpec struct {
	plan.DefaultCost

	Org    *NameOrID
	Bucket NameOrID
	Host   *string
	Token  *string
}

func (*FromProcedureSpec) Copy

func (*FromProcedureSpec) GetHost

func (s *FromProcedureSpec) GetHost() *string

func (*FromProcedureSpec) GetOrg

func (s *FromProcedureSpec) GetOrg() *NameOrID

func (*FromProcedureSpec) GetToken

func (s *FromProcedureSpec) GetToken() *string

func (*FromProcedureSpec) Kind

func (*FromProcedureSpec) PostPhysicalValidate

func (s *FromProcedureSpec) PostPhysicalValidate(id plan.NodeID) error

func (*FromProcedureSpec) SetHost

func (s *FromProcedureSpec) SetHost(host *string)

func (*FromProcedureSpec) SetOrg

func (s *FromProcedureSpec) SetOrg(org *NameOrID)

func (*FromProcedureSpec) SetToken

func (s *FromProcedureSpec) SetToken(token *string)

type FromRemoteProcedureSpec

type FromRemoteProcedureSpec struct {
	plan.DefaultCost
	influxdb.Config
	Bounds       flux.Bounds
	PredicateSet influxdb.PredicateSet
}

func (*FromRemoteProcedureSpec) Copy

func (*FromRemoteProcedureSpec) Kind

func (*FromRemoteProcedureSpec) PostPhysicalValidate

func (s *FromRemoteProcedureSpec) PostPhysicalValidate(id plan.NodeID) error

func (*FromRemoteProcedureSpec) TimeBounds

func (s *FromRemoteProcedureSpec) TimeBounds(predecessorBounds *plan.Bounds) *plan.Bounds

TimeBounds implements plan.BoundsAwareProcedureSpec

type FromRemoteRule

type FromRemoteRule struct{}

func (FromRemoteRule) Name

func (p FromRemoteRule) Name() string

func (FromRemoteRule) Pattern

func (p FromRemoteRule) Pattern() plan.Pattern

func (FromRemoteRule) Rewrite

func (p FromRemoteRule) Rewrite(ctx context.Context, node plan.Node) (plan.Node, bool, error)

type LabelAndOffset

type LabelAndOffset struct {
	Label  string
	Offset int
}

type MergeRemoteFilterRule

type MergeRemoteFilterRule struct{}

func (MergeRemoteFilterRule) Name

func (p MergeRemoteFilterRule) Name() string

func (MergeRemoteFilterRule) Pattern

func (p MergeRemoteFilterRule) Pattern() plan.Pattern

func (MergeRemoteFilterRule) Rewrite

func (p MergeRemoteFilterRule) Rewrite(ctx context.Context, node plan.Node) (plan.Node, bool, error)

type MergeRemoteRangeRule

type MergeRemoteRangeRule struct{}

func (MergeRemoteRangeRule) Name

func (p MergeRemoteRangeRule) Name() string

func (MergeRemoteRangeRule) Pattern

func (p MergeRemoteRangeRule) Pattern() plan.Pattern

func (MergeRemoteRangeRule) Rewrite

func (p MergeRemoteRangeRule) Rewrite(ctx context.Context, node plan.Node) (plan.Node, bool, error)

type Metric

type Metric = influxdb.Metric

type NameOrID

type NameOrID = influxdb.NameOrID

NameOrID signifies the name of an organization/bucket or an ID for an organization/bucket.

func GetNameOrID

func GetNameOrID(args flux.Arguments, nameParam, idParam string) (NameOrID, bool, error)

type Predicate

type Predicate = influxdb.Predicate

Predicate defines a predicate to filter storage with.

type PredicateSet

type PredicateSet = influxdb.PredicateSet

PredicateSet holds a set of predicates that will filter the results.

type ProcedureSpec

type ProcedureSpec interface {
	GetOrg() *NameOrID
	GetHost() *string
	GetToken() *string
	SetOrg(org *NameOrID)
	SetHost(host *string)
	SetToken(token *string)
}

type Provider

type Provider = influxdb.Provider

func GetProvider

func GetProvider(ctx context.Context) Provider

type RemoteProcedureSpec

type RemoteProcedureSpec interface {
	GetOrg() *NameOrID
	GetHost() *string
	GetToken() *string

	BuildQuery() *ast.File
}

type RowMetric

type RowMetric struct {
	NameStr string
	Tags    []*influxdb.Tag
	Fields  []*influxdb.Field
	TS      time.Time
}

RowMetric is a Metric

func (RowMetric) FieldList

func (r RowMetric) FieldList() []*influxdb.Field

func (RowMetric) Name

func (r RowMetric) Name() string

func (RowMetric) TagList

func (r RowMetric) TagList() []*influxdb.Tag

func (RowMetric) Time

func (r RowMetric) Time() time.Time

type Tag

type Tag = influxdb.Tag

type ToOpSpec

type ToOpSpec struct {
	Bucket            string                       `json:"bucket"`
	BucketID          string                       `json:"bucketID"`
	Org               string                       `json:"org"`
	OrgID             string                       `json:"orgID"`
	Host              string                       `json:"host"`
	Token             string                       `json:"token"`
	TimeColumn        string                       `json:"timeColumn"`
	MeasurementColumn string                       `json:"measurementColumn"`
	TagColumns        []string                     `json:"tagColumns"`
	FieldFn           interpreter.ResolvedFunction `json:"fieldFn"`
}

ToOpSpec is the flux.OperationSpec for the `to` flux function.

func (ToOpSpec) Kind

func (ToOpSpec) Kind() flux.OperationKind

Kind returns the kind for the ToOpSpec function.

func (*ToOpSpec) ReadArgs

func (o *ToOpSpec) ReadArgs(args flux.Arguments) error

ReadArgs reads the args from flux.Arguments into the op spec

type ToProcedureSpec

type ToProcedureSpec struct {
	plan.DefaultCost
	Spec *ToOpSpec
}

ToProcedureSpec is the procedure spec for the `to` flux function.

func (*ToProcedureSpec) Copy

Copy clones the procedure spec for `to` flux function.

func (*ToProcedureSpec) Kind

Kind returns the kind for the procedure spec for the `to` flux function.

func (*ToProcedureSpec) PassThroughAttribute

func (o *ToProcedureSpec) PassThroughAttribute(attrKey string) bool

type UnimplementedProvider

type UnimplementedProvider = influxdb.UnimplementedProvider

type WideToOpSpec

type WideToOpSpec struct {
	Org    NameOrID
	Bucket NameOrID
	Host   string
	Token  string
}

WideToOpSpec is the flux.OperationSpec for the `to` flux function.

func (WideToOpSpec) Kind

Kind returns the kind for the WideToOpSpec function.

func (*WideToOpSpec) ReadArgs

func (s *WideToOpSpec) ReadArgs(args flux.Arguments) error

ReadArgs reads the args from flux.Arguments into the op spec

type WideToProcedureSpec

type WideToProcedureSpec struct {
	plan.DefaultCost
	Config Config
}

WideToProcedureSpec is the procedure spec for the `to` flux function.

func (*WideToProcedureSpec) Copy

Copy clones the procedure spec for `to` flux function.

func (*WideToProcedureSpec) Kind

Kind returns the kind for the procedure spec for the `to` flux function.

type WideToTransformation

type WideToTransformation struct {
	execute.ExecutionNode
	// contains filtered or unexported fields
}

WideToTransformation is the transformation for the `to` flux function.

func NewWideToTransformation

NewWideToTransformation returns a new *WideToTransformation with the appropriate fields set.

func (*WideToTransformation) Finish

func (t *WideToTransformation) Finish(id execute.DatasetID, err error)

Finish is called after the `to` flux function's transformation is done processing.

func (*WideToTransformation) Process

func (t *WideToTransformation) Process(id execute.DatasetID, tbl flux.Table) error

Process does the actual work for the WideToTransformation.

func (*WideToTransformation) RetractTable

func (t *WideToTransformation) RetractTable(id execute.DatasetID, key flux.GroupKey) error

RetractTable retracts the table for the transformation for the `to` flux function.

func (*WideToTransformation) UpdateProcessingTime

func (t *WideToTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error

UpdateProcessingTime updates the processing time for the transformation for the `to` flux function.

func (*WideToTransformation) UpdateWatermark

func (t *WideToTransformation) UpdateWatermark(id execute.DatasetID, pt execute.Time) error

UpdateWatermark updates the watermark for the transformation for the `to` flux function.

type Writer

type Writer = influxdb.Writer

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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