model

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package model defines the structures and interfaces for query options and results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name   string
	Values []*modelv1.FieldValue
}

Field is a field name and its values.

type MeasureQueryOptions

type MeasureQueryOptions struct {
	Query           index.Query
	TimeRange       *timestamp.TimeRange
	Order           *index.OrderBy
	Name            string
	Entities        [][]*modelv1.TagValue
	TagProjection   []TagProjection
	FieldProjection []string
}

MeasureQueryOptions is the options of a measure query.

type MeasureQueryResult

type MeasureQueryResult interface {
	Pull() *MeasureResult
	Release()
}

MeasureQueryResult is the result of a measure query.

type MeasureResult

type MeasureResult struct {
	Error       error
	Timestamps  []int64
	Versions    []int64
	TagFamilies []TagFamily
	Fields      []Field
	SID         common.SeriesID
}

MeasureResult is the result of a query.

type StreamQueryOptions

type StreamQueryOptions struct {
	Name           string
	TimeRange      *timestamp.TimeRange
	Entities       [][]*modelv1.TagValue
	Filter         index.Filter
	Order          *index.OrderBy
	TagProjection  []TagProjection
	MaxElementSize int
}

StreamQueryOptions is the options of a stream query.

func (*StreamQueryOptions) CopyFrom added in v0.8.0

func (s *StreamQueryOptions) CopyFrom(other *StreamQueryOptions)

CopyFrom copies the StreamQueryOptions from other to s.

func (*StreamQueryOptions) Reset added in v0.8.0

func (s *StreamQueryOptions) Reset()

Reset resets the StreamQueryOptions.

type StreamQueryResult

type StreamQueryResult interface {
	Pull(context.Context) *StreamResult
	Release()
}

StreamQueryResult is the result of a stream query.

type StreamResult

type StreamResult struct {
	Error       error
	Timestamps  []int64
	ElementIDs  []uint64
	TagFamilies []TagFamily
	SIDs        []common.SeriesID
	// contains filtered or unexported fields
}

StreamResult is the result of a query.

func MergeStreamResults added in v0.8.0

func MergeStreamResults(results []*StreamResult, topN int, asc bool) *StreamResult

MergeStreamResults merges multiple StreamResult slices into a single StreamResult.

func NewStreamResult added in v0.8.0

func NewStreamResult(topN int, asc bool) *StreamResult

NewStreamResult creates a new StreamResult.

func (*StreamResult) CopyFrom added in v0.8.0

func (sr *StreamResult) CopyFrom(tmp, other *StreamResult) bool

CopyFrom copies the topN results from other to sr using tmp as a temporary result.

func (*StreamResult) CopySingleFrom added in v0.8.0

func (sr *StreamResult) CopySingleFrom(other *StreamResult)

CopySingleFrom copies a single result from other to sr.

func (*StreamResult) Len added in v0.8.0

func (sr *StreamResult) Len() int

Len returns the length of the StreamResult.

func (*StreamResult) Reset added in v0.8.0

func (sr *StreamResult) Reset()

Reset resets the StreamResult.

type StreamResultHeap added in v0.8.0

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

StreamResultHeap is a min-heap of StreamResult pointers.

func (StreamResultHeap) Len added in v0.8.0

func (h StreamResultHeap) Len() int

func (StreamResultHeap) Less added in v0.8.0

func (h StreamResultHeap) Less(i, j int) bool

func (*StreamResultHeap) Pop added in v0.8.0

func (h *StreamResultHeap) Pop() interface{}

Pop pops a StreamResult pointer from the heap.

func (*StreamResultHeap) Push added in v0.8.0

func (h *StreamResultHeap) Push(x interface{})

Push pushes a StreamResult pointer to the heap.

func (StreamResultHeap) Swap added in v0.8.0

func (h StreamResultHeap) Swap(i, j int)

type Tag

type Tag struct {
	Name   string
	Values []*modelv1.TagValue
}

Tag is a tag name and its values.

type TagFamily

type TagFamily struct {
	Name string
	Tags []Tag
}

TagFamily is a tag family name and its tags.

type TagProjection

type TagProjection struct {
	Family string
	Names  []string
}

TagProjection is the projection of a tag family and its tags.

Jump to

Keyboard shortcuts

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