fractal

package module
v0.0.0-...-52e8d5f Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

type Comparator func(item1, item2 *Item) int

Comparator should instruct the tree how to compare two items. A negative number should be returned if item1 is less than item2, a zero should be returned if they are equal, and a positive number should be returned if item1 is greater than item2.

type Config

type Config struct {
	Comparator Comparator
	Persister  Persister
}

type Item

type Item struct {
	Key     []byte
	Payload []byte
}

type Items

type Items []*Item

type Node

type Node struct {
	Key       []byte
	Items     Items
	MaxLength int
}

type NodeMap

type NodeMap struct {
	Layers map[int][]byte
}

type Persister

type Persister interface {
	Add(key, payload []byte) error
	Get(key []byte) ([]byte, error)
}

type Reader

type Reader interface {
	AsMutable() Writer
}

func New

func New(config Config) Reader

type Writer

type Writer interface {
	Commit() error
	Save(items ...*Item) error
}

Jump to

Keyboard shortcuts

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