weakcache

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package weakcache implements Weak Cache, eviction of entries are controlled by GC

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WeakCache

type WeakCache struct {
	sync.Map
	cache.UnImplementedCache
}

WeakCache data structure

func NewWeakCache

func NewWeakCache() *WeakCache

NewWeakCache constructor

func (*WeakCache) Delete

func (c *WeakCache) Delete(key string) bool

Delete deletes the key

func (*WeakCache) Get

func (c *WeakCache) Get(key string) (value string, ok bool)

Get value by key

func (*WeakCache) Put

func (c *WeakCache) Put(key string, value string) (created bool)

Put a new key value pair

func (*WeakCache) Restore added in v0.1.7

func (c *WeakCache) Restore(closer io.ReadCloser) error

func (*WeakCache) Snapshot added in v0.1.7

func (c *WeakCache) Snapshot() (raft.FSMSnapshot, error)

Jump to

Keyboard shortcuts

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