storage

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsEmpty = errors.New("pkg/storage: storage is empty")

Functions

func NewSqliteStorage

func NewSqliteStorage(dbName string, compressor compress.Compressor, cache cache.Cache) (*sqliteStorage, error)

Should be closed after being used

Types

type Node

type Node struct {
	LeftObject, RightObject *[]byte
	LeftChild, RightChild   *int64
}

type Position

type Position int
const (
	Left Position = iota
	Right
)

type Storage

type Storage interface {
	Get(nodeID int64) (node *Node, err error)
	SetObject(nodeID int64, position Position, marshaler encoding.BinaryMarshaler) error
	SetChild(nodeID int64, position Position, child int64) error
	NewNode(marshaler encoding.BinaryMarshaler) (nodeID int64, err error)
}

Jump to

Keyboard shortcuts

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