dstr

package
v0.0.0-...-459568a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheNode

type CacheNode struct {
	Key, Value interface{}
}

func (*CacheNode) NewCacheNode

func (cnode *CacheNode) NewCacheNode(k, v interface{}) *CacheNode

type LRUCache

type LRUCache struct {
	Capacity int
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(cap uint64) *LRUCache

func (*LRUCache) Get

func (lru *LRUCache) Get(k interface{}) (v interface{}, ret bool, err error)

func (*LRUCache) List

func (lru *LRUCache) List() *list.List

func (*LRUCache) Remove

func (lru *LRUCache) Remove(k interface{}) bool

func (*LRUCache) Set

func (lru *LRUCache) Set(k, v interface{})

func (*LRUCache) Size

func (lru *LRUCache) Size() int

type SafeMap

type SafeMap struct {
	*sync.RWMutex
	Map map[interface{}]interface{}
}

func NewSafeMap

func NewSafeMap() *SafeMap

func (*SafeMap) Check

func (m *SafeMap) Check(k interface{}) (interface{}, bool)

func (*SafeMap) Delete

func (m *SafeMap) Delete(k interface{})

func (*SafeMap) Get

func (m *SafeMap) Get(k interface{}) interface{}

func (*SafeMap) Set

func (m *SafeMap) Set(k interface{}, v interface{}) bool

Jump to

Keyboard shortcuts

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