dsl

package
v0.22.14 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StandardView   = "standard"
	Quantum        = "20060102"
	TimestampField = protoreflect.Name("timestamp")
	ID             = "_id"

	// It might be excessive but our goal is to be extremely useful and by having
	// database per shard we can afford being this granular
	//
	// Timeseries endpoints for vince requires
	IngestQuantum = "YMDH"
)

Variables

This section is empty.

Functions

func Bool added in v0.22.7

Bool writes a boolean proto value

func Bytes added in v0.22.7

func Bytes(r *roaring.Bitmap, tr *tr.Write, field protoreflect.FieldDescriptor, id uint64, value protoreflect.Value)

func Enum added in v0.22.7

Enum writes enum proto value

func Float64 added in v0.22.7

func Int64 added in v0.22.7

Int64 writes int64 proto value

func Millisecond added in v0.22.7

func Millisecond(value protoreflect.Value) time.Time

func Nanosecond added in v0.22.7

func Nanosecond(value protoreflect.Value) time.Time

func String added in v0.22.7

func String(r *roaring.Bitmap, tr *tr.Write, field protoreflect.FieldDescriptor, id uint64, value protoreflect.Value)

func Uint64 added in v0.22.7

func ViewKey added in v0.22.7

func ViewKey(field, view string) string

Types

type Fields added in v0.22.7

type Fields map[string]*roaring.Bitmap

type Ops added in v0.22.7

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

func (*Ops) Close added in v0.22.7

func (o *Ops) Close() error

type Option added in v0.22.10

type Option[T proto.Message] func(store *Store[T])

func WithSkip added in v0.22.14

func WithSkip[T proto.Message](field ...string) Option[T]

func WithTimestampField added in v0.22.11

func WithTimestampField[T proto.Message](name string) Option[T]

type RangeCallback added in v0.22.7

type RangeCallback func(shard uint64, views Views) error

type Reader added in v0.22.7

type Reader[T proto.Message] struct {
	// contains filtered or unexported fields
}

func (Reader[T]) Range added in v0.22.7

func (r Reader[T]) Range(start, end time.Time) []Shard

Range returns shards for the time range. We select possible views to read from based on start and end.

We Store Hour, Day, Month and Year Quantum.

func (Reader[T]) RangeUnit added in v0.22.7

func (r Reader[T]) RangeUnit(start, end time.Time, unit rune) []Shard

func (*Reader[T]) Release added in v0.22.7

func (r *Reader[T]) Release() error

func (Reader[T]) Standard added in v0.22.7

func (r Reader[T]) Standard() Shard

Standard returns the standard shard. Use this to query global data

func (*Reader[T]) Tr added in v0.22.7

func (r *Reader[T]) Tr() *tr.Read

func (*Reader[T]) View added in v0.22.7

func (r *Reader[T]) View(shard Shard, f func(txn *tx.Tx) error) error

type Schema added in v0.22.7

type Schema[T proto.Message] struct {
	// contains filtered or unexported fields
}

Schema maps proto fields to rbf types.

func (*Schema[T]) Commit added in v0.22.7

func (s *Schema[T]) Commit(m map[string]*roaring.Bitmap) error

func (*Schema[T]) Range added in v0.22.7

func (s *Schema[T]) Range(f RangeCallback) error

func (*Schema[T]) Release added in v0.22.7

func (s *Schema[T]) Release() (err error)

func (*Schema[T]) Save added in v0.22.7

func (s *Schema[T]) Save() error

func (*Schema[T]) Write added in v0.22.7

func (s *Schema[T]) Write(msg T) error

type Shard added in v0.22.7

type Shard struct {
	Shard uint64
	Views []string
}

type Shards added in v0.22.7

type Shards map[uint64]Views

type Store added in v0.22.7

type Store[T proto.Message] struct {
	// contains filtered or unexported fields
}

func New added in v0.22.7

func New[T proto.Message](path string, opts ...Option[T]) (*Store[T], error)

func (*Store[T]) Append added in v0.22.7

func (s *Store[T]) Append(data []T) error

func (*Store[T]) Close added in v0.22.7

func (s *Store[T]) Close() error

func (*Store[T]) DB added in v0.22.7

func (s *Store[T]) DB() *db.Shards

func (*Store[T]) Reader added in v0.22.7

func (s *Store[T]) Reader() (*Reader[T], error)

Reader creates a new Reader for querying the store T. Make sure the reader is released after use.

func (*Store[T]) Schema added in v0.22.7

func (s *Store[T]) Schema() (*Schema[T], error)

type Views added in v0.22.7

type Views map[string]Fields

type Writers added in v0.22.7

type Writers map[string]writeFn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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