lib

package
v0.0.0-...-2ee7648 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMap

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

CMap is concurrent map with generic key and value as interface{} type

func NewCMap

func NewCMap() *CMap

NewCMap make new CMap

func (*CMap) Exist

func (c *CMap) Exist(key interface{}) bool

func (*CMap) Get

func (c *CMap) Get(key interface{}) interface{}

func (*CMap) Keys

func (c *CMap) Keys() []interface{}

func (*CMap) Set

func (c *CMap) Set(key, value interface{})

type Graph

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

func NewGraph

func NewGraph() *Graph

func (*Graph) Add

func (g *Graph) Add(v interface{})

func (*Graph) AddEdge

func (g *Graph) AddEdge(from interface{}, to interface{})

func (*Graph) BFS

func (g *Graph) BFS(v interface{}) []interface{}

BFS returns breadth first search vertices from a given source

func (*Graph) Cyclic

func (g *Graph) Cyclic() bool

Cyclic returns true if the graph contains a cycle

func (*Graph) From

func (g *Graph) From(v interface{}) Set

From returns all vertices in graph that can be reached directly from v

func (*Graph) Has

func (g *Graph) Has(v interface{}) bool

func (*Graph) Remove

func (g *Graph) Remove(v interface{})

func (*Graph) Size

func (g *Graph) Size() int

func (*Graph) To

func (g *Graph) To(v interface{}) Set

To returns all vertices that can reach to v

func (*Graph) Vertices

func (g *Graph) Vertices() Set

type MMap

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

func NewMMap

func NewMMap() *MMap

func (*MMap) Get

func (m *MMap) Get(key interface{}, version interface{}) interface{}

func (*MMap) Keys

func (m *MMap) Keys() []interface{}

func (*MMap) Put

func (m *MMap) Put(key interface{}, key2 interface{}, value interface{})

func (*MMap) SecondaryKeys

func (m *MMap) SecondaryKeys(key interface{}) []interface{}

type Queue

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

func NewQueue

func NewQueue() *Queue

func (*Queue) Pop

func (q *Queue) Pop() interface{}

func (*Queue) Push

func (q *Queue) Push(e interface{})

func (*Queue) Size

func (q *Queue) Size() int

type Set

type Set map[interface{}]struct{}

func NewSet

func NewSet() Set

func (Set) Add

func (s Set) Add(e interface{})

func (Set) Has

func (s Set) Has(e interface{}) bool

func (Set) Remove

func (s Set) Remove(e interface{})

func (Set) Slice

func (s Set) Slice() []interface{}

Jump to

Keyboard shortcuts

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