systemicdb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExpiredCollectionCycles int64

Functions

This section is empty.

Types

type NodeData

type NodeData struct {
	Key    string
	Value  []byte
	Expiry int64
}

type SystemicDB added in v0.0.2

type SystemicDB struct {
	Meta sdbMeta
	// contains filtered or unexported fields
}

func NewSystemicDB

func NewSystemicDB() *SystemicDB

NewSystemicDB simply creates a new instance of the SystemicDB AVL Tree, starts the expired garbage collector and returns a pointer

func (*SystemicDB) Exists added in v0.0.2

func (t *SystemicDB) Exists(keyStr string) bool

Exists searches for an element in the AVL Tree and return a bool (true is exists)

func (*SystemicDB) Get added in v0.0.2

func (t *SystemicDB) Get(keyStr string) *NodeData

Get searches for an element in the AVL Tree and returns a NodeData struct which is important parts of the node that a user could need

func (*SystemicDB) GetCollectionCycleCount added in v0.0.2

func (t *SystemicDB) GetCollectionCycleCount() *int64

GetCollectionCycleCount returns a int64 of a count of how many times the expiredGC has run, this is used for testing

func (*SystemicDB) Insert added in v0.0.2

func (t *SystemicDB) Insert(keyStr string, value []byte, expiry time.Duration) *node

Insert inserts an element into the AVL Tree and returns the newly created node (includes a rebalance of the tree)

func (*SystemicDB) IsBalanced added in v0.0.2

func (t *SystemicDB) IsBalanced() bool

IsBalanced returns true if the AVL Tree is balanced.

func (*SystemicDB) Max added in v0.0.2

func (t *SystemicDB) Max() uint64

Max returns the maximum element in the AVL Tree.

func (*SystemicDB) Min added in v0.0.2

func (t *SystemicDB) Min() uint64

Min returns the minimum element in the AVL Tree.

func (*SystemicDB) Remove added in v0.0.2

func (t *SystemicDB) Remove(keyStr string)

Remove removes an element from the AVL Tree (includes a rebalance of the tree)

Jump to

Keyboard shortcuts

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