hsk

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: GPL-3.0 Imports: 5 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Seed() error
}

type Filter

type Filter interface {
	// Enables a single central function to cast from husk.Dataer to <Entity>
	Filter(obj Record) bool
}

Filter used to filter records while searching.

type Index

type Index interface {
	/// Create new entry in this index that maps value.Key K to value V
	Add(m Meta) (Key, error)
	Set(k Key, v Meta) error
	/// Find an entry by key
	Get(k Key) Meta
	IndexOf(k Key) int
	/// Delete all entries of given key
	Delete(k Key) bool

	GetKeys() []Key
}

Index is used to manage data and where it's located

type Key

type Key interface {
	collections.Comparable
	fmt.Stringer
	json.Marshaler
	json.Unmarshaler
	GetTimestamp() time.Time
}

type Mapper

type Mapper interface {
	Map(result interface{}, obj Record) error
}

Mapper updates the result set with values from data

type Meta

type Meta interface {
	IsActive() bool
	Disable()
	Enable()

	Update(p Point)
	Point() Point
}

func NewMeta

func NewMeta() Meta

func NewMetaWithPoint added in v1.7.0

func NewMetaWithPoint(p Point) Meta

type Point

type Point interface {
	GetOffset() int64
	GetLength() int64
}

func NewPoint

func NewPoint(offset, length int64) Point

type Record

type Record interface {
	GetKey() Key
	GetValue() validation.Dataer
}

Record is what defines a record, and what it can do

type Storage added in v1.7.0

type Storage interface {
	Read(p Point, data chan<- Record)
	Write(obj Record, p chan<- Point)
	Close() error
	Name() string
	ZeroValue() validation.Dataer
}

Storage stores meta with some knowledge of data, a wrapper for a reader/writer

Jump to

Keyboard shortcuts

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