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 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址