safemap

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 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 AutoGcMap

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

AutoGcMap 因为 golang 设计 map 为了复用 key, 删除不会真正的删除, 只是软删除

func NewAutoGcMap

func NewAutoGcMap(length, mThreshold int) *AutoGcMap

func (*AutoGcMap) Del

func (m *AutoGcMap) Del(i interface{})

func (*AutoGcMap) Get

func (m *AutoGcMap) Get(i interface{}) (v interface{}, exists bool)

func (*AutoGcMap) Set

func (m *AutoGcMap) Set(i interface{}, v interface{})

func (*AutoGcMap) Size

func (m *AutoGcMap) Size() int

type SafeGcMap

type SafeGcMap interface {
	Get(interface{}) (interface{}, bool)
	Set(interface{}, interface{})
	Del(interface{})
	Size() int
}

Jump to

Keyboard shortcuts

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