storage

package
v0.0.0-...-2c1a1e5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColdStorageService

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

func NewColdStorageService

func NewColdStorageService(dataDir string) (*ColdStorageService, error)

func (*ColdStorageService) CollectionExists

func (svc *ColdStorageService) CollectionExists(id string) (bool, error)

func (*ColdStorageService) FlushToDisk

func (svc *ColdStorageService) FlushToDisk(id string, data Collection) error

func (*ColdStorageService) ListCollections

func (svc *ColdStorageService) ListCollections() ([]string, error)

func (*ColdStorageService) ReadFromDiskForId

func (svc *ColdStorageService) ReadFromDiskForId(id string) (Collection, error)

type Collection

type Collection map[string]string

type Engine

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

func NewEngine

func NewEngine(dataDir string, autoCreate bool) (*Engine, error)

func (*Engine) CollectionExists

func (e *Engine) CollectionExists(id string) (bool, error)

check if a collection exists across hot and cold storage for a given collection id

func (*Engine) FlushAllCollections

func (e *Engine) FlushAllCollections() []error

func (*Engine) FlushCollection

func (e *Engine) FlushCollection(id string) error

func (*Engine) IsHot

func (e *Engine) IsHot(id string) (bool, error)

check if a collection is hot for a given collection id

func (*Engine) ListCollections

func (e *Engine) ListCollections() ([]string, error)

list all distinct collections across both hot and cold storage

func (*Engine) LoadCollection

func (e *Engine) LoadCollection(id string) error

func (*Engine) LoadCollectionIfNotPresent

func (e *Engine) LoadCollectionIfNotPresent(id string) error

func (*Engine) ReadKey

func (e *Engine) ReadKey(id, key string) (string, error)

func (*Engine) WriteKey

func (e *Engine) WriteKey(id, key, value string) error

type HotStorageService

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

func NewHotStorageService

func NewHotStorageService() (*HotStorageService, error)

func (*HotStorageService) CollectionExists

func (svc *HotStorageService) CollectionExists(id string) bool

func (*HotStorageService) CreateCollection

func (svc *HotStorageService) CreateCollection(id string) error

func (*HotStorageService) DropCollection

func (svc *HotStorageService) DropCollection(id string) error

func (*HotStorageService) ListCollections

func (svc *HotStorageService) ListCollections() []string

func (*HotStorageService) ReadKey

func (svc *HotStorageService) ReadKey(id, key string) (string, error)

func (*HotStorageService) WriteKey

func (svc *HotStorageService) WriteKey(id, key, value string) error

Jump to

Keyboard shortcuts

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