weakcache

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: BSD-2-Clause Imports: 3 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
}

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

Jump to

Keyboard shortcuts

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