storage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsLive           = "is_live"
	SelectorKeyCount = "count"
	IsFirstQuery     = "is_first_query"

	// container meta
	ContainerName = "container_name"
	PodName       = "pod_name"
	PodNamespace  = "pod_namespace"
	ClusterName   = "cluster_name"
	ID            = "id"
	PipelineID    = "pipelineID"

	// fall back
	IsFallBack = "is_fall_back"
)
View Source
const (
	AllFields        = ReturnFieldMode(0)
	ExcludeTagsField = ReturnFieldMode(1)
	OnlyIdContent    = ReturnFieldMode(2)
)
View Source
const (
	Default     = IterateStyle(0)
	SearchAfter = IterateStyle(1)
	Scroll      = IterateStyle(2)
)
View Source
const (
	AggregationHistogram = AggregationType("histogram")
	AggregationTerms     = AggregationType("terms")
)

Variables

View Source
var DefaultComparer = Comparer{}

DefaultComparer

Functions

func Compare

func Compare(al, bl *pb.LogItem) int

Compare .

Types

type Aggregation

type Aggregation struct {
	*Selector
	Aggs []*AggregationDescriptor
}

type AggregationBucket

type AggregationBucket struct {
	Key   interface{}
	Count int64
}

type AggregationDescriptor

type AggregationDescriptor struct {
	Name    string
	Field   string
	Typ     AggregationType
	Options interface{}
}

type AggregationResponse

type AggregationResponse struct {
	Total        int64
	Aggregations map[string]*AggregationResult
}

type AggregationResult

type AggregationResult struct {
	Buckets []*AggregationBucket
}

type AggregationType

type AggregationType string

type Aggregator

type Aggregator interface {
	Aggregate(ctx context.Context, req *Aggregation) (*AggregationResponse, error)
}

func NewMergedAggregator

func NewMergedAggregator(aggregators ...Aggregator) (Aggregator, error)

type Comparer

type Comparer struct{}

Comparer .

func (Comparer) Compare

func (c Comparer) Compare(a, b interface{}) int

type Filter

type Filter struct {
	Key   string
	Op    Operator
	Value interface{}
}

Filter .

type HistogramAggOptions

type HistogramAggOptions struct {
	PreferredPoints int64
	MinimumInterval int64
	FixedInterval   int64
}

type IterateStyle

type IterateStyle int32

type Logs

type Logs []*pb.LogItem

Logs .

func (Logs) Len

func (l Logs) Len() int

func (Logs) Less

func (l Logs) Less(i, j int) bool

func (Logs) Swap

func (l Logs) Swap(i, j int)

type MergedAggregator

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

func (*MergedAggregator) Aggregate

type Operator

type Operator int32

Operator .

const (
	// EQ equal
	EQ Operator = iota
	REGEXP
	EXPRESSION
	CONTAINS
)

type QueryMeta

type QueryMeta struct {
	OrgNames              []string
	MspEnvIds             []string
	Highlight             bool
	PreferredBufferSize   int
	PreferredIterateStyle IterateStyle
	PreferredReturnFields ReturnFieldMode
}

type ResultSkip

type ResultSkip struct {
	AfterId    *UniqueId
	FromOffset int
}

type ReturnFieldMode

type ReturnFieldMode int32

type Selector

type Selector struct {
	Start   int64
	End     int64
	Scheme  string
	Filters []*Filter
	Debug   bool
	Meta    QueryMeta
	Skip    ResultSkip
	Options map[string]interface{}
}

Selector .

type Storage

type Storage interface {
	NewWriter(ctx context.Context) (storekit.BatchWriter, error)
	Iterator(ctx context.Context, sel *Selector) (storekit.Iterator, error)
}

Storage .

type TermsAggOptions

type TermsAggOptions struct {
	Size    int64
	Missing interface{}
}

type UniqueId

type UniqueId struct {
	Timestamp int64
	Id        string
	Offset    int64
}

func (*UniqueId) Raw

func (id *UniqueId) Raw() []interface{}

func (*UniqueId) ShortId

func (id *UniqueId) ShortId() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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