def

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBucket added in v0.0.12

func WithBucket(bucket string) func(*TsdbQueryOptions)

func WithEnd added in v0.0.12

func WithEnd(end time.Time) func(*TsdbQueryOptions)

func WithFields added in v0.0.12

func WithFields(fields ...string) func(*TsdbQueryOptions)

func WithGroup added in v0.0.12

func WithGroup(group ...string) func(*TsdbQueryOptions)

func WithMeasurement added in v0.0.12

func WithMeasurement(measurement string) func(*TsdbQueryOptions)

func WithQuery added in v0.0.12

func WithQuery(query string) func(*TsdbQueryOptions)

func WithStart added in v0.0.12

func WithStart(start time.Time) func(*TsdbQueryOptions)

func WithTag added in v0.0.12

func WithTag(key string, op tsdb.TagOp, values ...string) func(*TsdbQueryOptions)

Types

type Point added in v0.0.11

type Point struct {
	Measurement string
	Bucket      string
	Tags        map[string]string
	Fields      map[string]any
	Time        time.Time
}

type PointBuilder added in v0.0.11

type PointBuilder struct {
	// contains filtered or unexported fields
}

func NewPointBuilder added in v0.0.11

func NewPointBuilder(measurement string) *PointBuilder

func (*PointBuilder) Build added in v0.0.11

func (pb *PointBuilder) Build() Point

func (*PointBuilder) Field added in v0.0.11

func (pb *PointBuilder) Field(key string, value any) *PointBuilder

func (*PointBuilder) Fields added in v0.0.11

func (pb *PointBuilder) Fields(fields map[string]any) *PointBuilder

func (*PointBuilder) Tag added in v0.0.11

func (pb *PointBuilder) Tag(key, value string) *PointBuilder

func (*PointBuilder) Tags added in v0.0.11

func (pb *PointBuilder) Tags(tags map[string]string) *PointBuilder

func (*PointBuilder) Time added in v0.0.11

func (pb *PointBuilder) Time(t time.Time) *PointBuilder

type Series added in v0.0.12

type Series struct {
	Name    string            `json:"name,omitempty"`
	Tags    map[string]string `json:"tags,omitempty"`
	Columns []string          `json:"columns,omitempty"`
	Values  [][]any           `json:"values,omitempty"`
}

type TsdbQueryOptions added in v0.0.12

type TsdbQueryOptions struct {
	Bucket      string
	Measurement string
	Fields      []string
	Groups      []string

	Start *time.Time
	End   *time.Time
	Query *string
	// contains filtered or unexported fields
}

func (*TsdbQueryOptions) Apply added in v0.0.12

func (t *TsdbQueryOptions) Apply(opts ...func(*TsdbQueryOptions))

func (*TsdbQueryOptions) GetQuery added in v0.0.12

func (t *TsdbQueryOptions) GetQuery() (string, error)

type TsdbReader added in v0.0.12

type TsdbReader interface {
	Query(ctx context.Context, opts ...func(*TsdbQueryOptions)) ([]*Series, error)
	Close() error
}

type TsdbWriter added in v0.0.11

type TsdbWriter interface {
	LogPoint(ctx context.Context, bucket, measurement string, tags map[string]string, fields map[string]any) error
	LogPointWithTime(ctx context.Context, bucket, measurement string, tags map[string]string, fields map[string]any, date time.Time) error
	LogPoints(ctx context.Context, bucket string, points []Point) error
	LogPointToDefault(ctx context.Context, measurement string, tags map[string]string, fields map[string]any) error
	Counter(ctx context.Context, bucket, measurement string, tags map[string]string, value float64) error
	Gauge(ctx context.Context, bucket, measurement string, tags map[string]string, value float64) error
	Histogram(ctx context.Context, bucket, measurement string, tags map[string]string, value float64) error
	Summary(ctx context.Context, bucket, measurement string, tags map[string]string, value float64) error
	Ping(ctx context.Context) error
	Close() error
}

Jump to

Keyboard shortcuts

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