cabinet

package module
v0.0.0-...-0d8c68f Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 5 Imported by: 1

README

cabinet

A library for the tree-structure topics manager in Go with zero memory allocations.

% sysctl -a | grep machdep.cpu | grep 'brand_'
machdep.cpu.brand_string: Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz

% go test -bench=. -benchtime=10s
goos: darwin
goarch: amd64
pkg: github.com/TheSmallBoat/cabinet
BenchmarkTopicNode-4    1000000000               0.529 ns/op           0 B/op          0 allocs/op
BenchmarkTopicTree-4    1000000000               0.481 ns/op           0 B/op          0 allocs/op
PASS
ok      github.com/TheSmallBoat/cabinet 8.803s

Documentation

Index

Constants

View Source
const (
	// MWC is the multi-level wildcard
	MWC = "#"

	// SWC is the single level wildcard
	SWC = "+"

	// SEP is the topic level separator
	SEP = "/"

	// SYS is the starting character of the system level topics
	SYS = "$"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TTree

type TTree struct {
	// contains filtered or unexported fields
}

func NewTopicTree

func NewTopicTree() *TTree

func (*TTree) Close

func (tr *TTree) Close() error
func (tr *TTree) EntityLink(topic []byte, entity interface{}) error
func (tr *TTree) EntityUnLink(topic []byte, entity interface{}) error

func (*TTree) LinkedEntities

func (tr *TTree) LinkedEntities(topic []byte, entities *[]interface{}) error

Returned values will be invalidated by the next ConnectedEntities call

Jump to

Keyboard shortcuts

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