temporal

package
v0.0.0-...-052eaa2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const KEYFRAME_RATE = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff []byte

type Map

type Map interface {
	ToBytes() []byte
	GetTimeRange() (time.Time, time.Time)
	Add(timestamp time.Time, key string, value []byte)
	GetItem(timestamp time.Time, key string) []byte
	Update(timestamp time.Time, key string, value []byte)
	Remove(timestamp time.Time, key string)
	GetStateAtTime(timestamp time.Time) map[string][]byte
	FindNextTimeKey(timestamp time.Time, dir int, key string) (time.Time, error)
}

func FromBytes

func FromBytes(b []byte) Map

func New

func New() Map

New creates a new empty TimedMap.

type TimeValueStore

type TimeValueStore struct {
	Keyframes []keyFrame
}

TimeValueStore holds the values and diffs with associated timestamps

func NewTimeValueStore

func NewTimeValueStore() *TimeValueStore

func (*TimeValueStore) AddValue

func (store *TimeValueStore) AddValue(timestamp time.Time, value []byte)

Add a value that is valid @timestamp and after

func (*TimeValueStore) FindNextTimeKey

func (store *TimeValueStore) FindNextTimeKey(timestamp time.Time, dir int) (time.Time, error)

func (*TimeValueStore) QueryValue

func (store *TimeValueStore) QueryValue(timestamp time.Time) []byte

Jump to

Keyboard shortcuts

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