btree

package
v0.0.0-...-a9a9d8c Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrOpenFile

func CreateOrOpenFile(path string) (*os.File, error)

Types

type Btree

type Btree[T any] struct {
	// contains filtered or unexported fields
}

Btree - Our in memory Btree struct

func InitializeBtree

func InitializeBtree[T any](optionalPath ...string) (*Btree[T], error)

NewBtree - Create a new btree

func (*Btree[T]) Count

func (bt *Btree[T]) Count() (int, error)

Count returns number of pairs stored

func (*Btree[T]) Error

func (bt *Btree[T]) Error() error

func (*Btree[T]) Get

func (bt *Btree[T]) Get(key string) (string, time.Time, bool, error)

func (*Btree[T]) Insert

func (bt *Btree[T]) Insert(value *pair.Pairs) error

Insert - Insert element in tree

func (*Btree[T]) IsRootNode

func (bt *Btree[T]) IsRootNode(n node) bool

func (*Btree[T]) Iterate

func (bt *Btree[T]) Iterate(f func(key string, val string, addedAt time.Time) error) error

func (*Btree[T]) SetRootNode

func (bt *Btree[T]) SetRootNode(n node)

func (*Btree[T]) Size

func (bt *Btree[T]) Size() int

Size returns number of Nodes | well, should, this one is wrong

Jump to

Keyboard shortcuts

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