datastructs

package
v0.0.0-...-c0334d6 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnitTest_Queue

func UnitTest_Queue(max int32, pushSleep, popSleep time.Duration)

Types

type Chan

type Chan struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewChan

func NewChan(count int32, listener ChanListener) *Chan

NewChan create and open channel.

func (*Chan) Close

func (owner *Chan) Close()

Close close and destroy channel.

func (*Chan) Write

func (owner *Chan) Write(data interface{})

Write write data to channel.

type ChanListener

type ChanListener func(interface{})

type Hash

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

Hash TODO.

func NewHash

func NewHash(count int32) *Hash

NewHash TODO.

func (*Hash) Add

func (owner *Hash) Add(key interface{}, value interface{})

Add TODO.

func (*Hash) Del

func (owner *Hash) Del(key interface{})

Del TODO.

func (*Hash) ForRange

func (owner *Hash) ForRange(f func(key interface{}, value interface{}))

ForRange TODO.

func (*Hash) ForRangeWithBreak

func (owner *Hash) ForRangeWithBreak(f func(key interface{}, value interface{}) bool)

ForRangeWithBreak TODO.

func (*Hash) Get

func (owner *Hash) Get(key interface{}) interface{}

Get TODO.

func (*Hash) Len

func (owner *Hash) Len() int

Len TODO.

func (*Hash) Set

func (owner *Hash) Set(key interface{}, value interface{})

Set TODO.

type List

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

func NewList

func NewList(max int32) *List

create new list.

func (*List) Del

func (this *List) Del(index uint32) (interface{}, error)

delete.

func (*List) ForRange

func (this *List) ForRange(f func(index int32, value interface{}))

for range.

func (*List) Get

func (this *List) Get(index uint32) (interface{}, error)

get.

func (*List) Insert

func (this *List) Insert(index uint32, element interface{}) error

insert.

func (*List) Len

func (this *List) Len() int

length.

func (*List) PushBack

func (this *List) PushBack(element interface{}) error

pushback.

func (*List) PushFront

func (this *List) PushFront(element interface{}) error

pushfront.

func (*List) String

func (this *List) String() string

data to string.

type Queue

type Queue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(max int32) *Queue

func (*Queue) Pop

func (this *Queue) Pop() (interface{}, error)

func (*Queue) Push

func (this *Queue) Push(data interface{}) error

type Stack

type Stack struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStack

func NewStack(max int32) *Stack

func (*Stack) Pop

func (this *Stack) Pop() (interface{}, error)

func (*Stack) Push

func (this *Stack) Push(data interface{}) error

Jump to

Keyboard shortcuts

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