Help us shape the future of Go! Take the 2026 Go Developer Survey

caching

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IncRCU

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

IncRCU wraps normal map as an incremental RCU (Read-Copy-Update) cache

WARN: It's only used for **Fixed** key-val relation, changing a value mapped to same key is **NOT** allowed

func NewRCUI64

func NewRCUI64(p *map[int64]interface{}, maxCAS int) IncRCU

NewRCUI64 accepts map[int]interface{} as RCU

WARN: this API can be only used on the IncRCU returned by `NewRCUI64()`

func NewRCUStr

func NewRCUStr(p *map[string]interface{}, maxCAS int) IncRCU

NewRCUI64 accepts map[int]interface{} as RCU

WARN: this API can be only used on the IncRCU returned by `NewRCUStr()`

func (*IncRCU) DumpI64

func (self *IncRCU) DumpI64() (ret map[int64]interface{})

DumpStr dumps all the key-values in the cache

func (*IncRCU) DumpStr

func (self *IncRCU) DumpStr() (ret map[string]interface{})

DumpStr dumps all the key-values in the cache

func (*IncRCU) GetByI64

func (self *IncRCU) GetByI64(id int64) interface{}

GetByI64 returns corresponding val of int64 id

WARN: this API can be only used on the IncRCU returned by `NewRCUI64()`

func (*IncRCU) GetByStr

func (self *IncRCU) GetByStr(id string) interface{}

GetByStr returns corresponding val of string id to

WARN: this API can be only used on the IncRCU returned by `NewRCUStr()`

func (*IncRCU) SetByI64

func (self *IncRCU) SetByI64(id int64, val interface{}) (exist bool)

SetByI64 stores int64 id and any val into the cache, and tells if the id already set

WARN: this API can be only used on the IncRCU returned by `NewRCUI64()`

func (*IncRCU) SetByStr

func (self *IncRCU) SetByStr(id string, val interface{}) (exist bool)

SetByStr stores string id and any val into the cache, and tells if the id already set

WARN: this API can be only used on the IncRCU returned by `NewRCUStr()`

Jump to

Keyboard shortcuts

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