store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUlid

func GenUlid() ulid.ULID

Types

type DB

type DB interface {
	Set(k Key, v string) error
	Get(k Key) (string, error)
	Del(keys []string) error
	Scan(ScannerOpt ScannerOptions) error
	Size() int64
	GC() error
	Close()
}

DB - database interface

type DBType

type DBType int
const (
	BADGER DBType = iota
	BOLT
	PEBBLE
)

type Handler

type Handler func(k Key, v string) bool

Handler - handler used for the scanner options

type Key

type Key struct {
	// TimeSeries Identifier
	ID ulid.ULID // 16 byte array

	// Stream name
	Stream StreamID

	// Version offset
	Version []byte
}

Key - structure to hold both stream and version

func NewEventKey

func NewEventKey(stream, version []byte) Key

NewEventKey - create a new Event with defined Ulid

type ScannerOptions

type ScannerOptions struct {
	// from where to start
	Offset []byte

	// whether to include the value of the offset in the result or not
	IncludeOffset bool

	// the prefix that must be exists in each key in the iteration
	Prefix []byte

	// fetch the values (true) or this is a key only iteration (false)
	FetchValues bool

	// fetch values from the time series index
	Index bool

	// the handler that handles the incoming data
	Handler Handler
}

ScannerOptions - represents the options for a scanner

type StreamID

type StreamID []byte

Stream ID - id type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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