datastore

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStorage added in v0.4.0

type DataStorage interface {
	Get(string, string) (string, bool)
	GetKeys(string) ([]string, bool)
	Set(string, string, string) error
	Delete(string, string)
	DeleteAll(string)
	Exists(string) bool
	Err() error
	Close() error
}

DataStorage is an interface for a data storage system. It defines methods for getting, setting, deleting, and checking the existence of data. The interface is designed to be implemented by different storage backends, such as in-memory storage, file-based storage, or database storage.

type Frames

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

Frames is the store for data that is specific to a single frame. It is used to store data that is associated with a specific frame in a video or image sequence. The data is stored in a map where the key is the frame number and the value is another map that contains key-value pairs of data associated with that frame.

func NewFrames

func NewFrames() *Frames

NewFrames creates a new Frames data store.

func (*Frames) Delete

func (s *Frames) Delete(frame int, key string)

Delete deletes data for a specific frame from the store.

func (*Frames) DeleteAll

func (s *Frames) DeleteAll(frame int)

DeleteAll deletes all data for a specific frame from the store.

func (*Frames) Exists

func (s *Frames) Exists(frame int) bool

Exists returns true if there is any data for a specific frame in the store.

func (*Frames) Get

func (s *Frames) Get(frame int, key string) (string, bool)

Get returns a data value for a specific frame from the store .

func (*Frames) GetKeys

func (s *Frames) GetKeys(frame int) ([]string, bool)

GetKeys returns all the keys for a specific frame from the store.

func (*Frames) Set

func (s *Frames) Set(frame int, key, val string) error

Set sets a key/value for a specific frame in the store.

type Processors

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

Processors is the store for data that is not specific to a single frame but applies to a single processor.

func NewProcessors

func NewProcessors(s DataStorage) *Processors

NewProcessors creates a new Processors data store.

func (*Processors) Close added in v0.4.0

func (s *Processors) Close() error

Close closes the underlying storage.

func (*Processors) Delete

func (s *Processors) Delete(processor string, key string)

Delete deletes data from the store.

func (*Processors) DeleteAll

func (s *Processors) DeleteAll(processor string)

DeleteAll deletes all data for a specific processor from the store.

func (*Processors) Err added in v0.4.0

func (s *Processors) Err() error

Err returns last operational error if any. nil otherwise.

func (*Processors) Exists

func (s *Processors) Exists(processor string) bool

Exists returns true if there is any data for a specific processor in the store.

func (*Processors) Get

func (s *Processors) Get(processor string, key string) (string, bool)

Get returns a data value from the store.

func (*Processors) GetKeys

func (s *Processors) GetKeys(processor string) ([]string, bool)

GetKeys returns all the keys for a specific processor from the store.

func (*Processors) Set

func (s *Processors) Set(processor string, key string, val string) error

Set sets a config value in the store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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