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

kvcache

package
v7.0.101 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[K comparable, V any] struct {
	// contains filtered or unexported fields
}

Cache - Provides simple mechanism to hold any key value in memory wrapped around via sync.Map but typed with generics.

func (*Cache[K, V]) Delete

func (r *Cache[K, V]) Delete(key K)

Delete delete the key

func (*Cache[K, V]) Get

func (r *Cache[K, V]) Get(key K) (value V, ok bool)

Get - Returns a value of a given key if it exists.

func (*Cache[K, V]) Set

func (r *Cache[K, V]) Set(key K, value V)

Set - Will persist a value into cache.

Jump to

Keyboard shortcuts

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