shm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package shm provides a neat way of storing key-val data. The hash map contains one or multiple sub-trees and each sub-tree contains multiple nodes. Each node has its own properties and keeps its own value. Although sub-tree hash maps is very simple data structure on top of Go maps it's so powerful.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Map stores all the subtrees.

func New

func New() *Map

New creates a new subtree hash map.

func (*Map) DelSubtree

func (m *Map) DelSubtree(key string) *Map

DelSubtree deletes specified subtree from current hash map.

func (*Map) Subtree

func (m *Map) Subtree(key string) *subtree

Subtree returns specified subtree from current hash map. A subtree can be iterated like a normal Go map.

func (*Map) SubtreeOk

func (m *Map) SubtreeOk(key string) (s *subtree, ok bool)

SubtreeOk returns specified subtree from current hash map, it also returns ok flag which indicates nodes existence.

Jump to

Keyboard shortcuts

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