kv

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: LGPL-3.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 KV

type KV[V any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

KV - Key Value store

func New

func New[V any]() *KV[V]

New KV store

func (*KV[V]) Get

func (c *KV[V]) Get(key string) V

Get an item from store

func (*KV[V]) Has

func (c *KV[V]) Has(key string) bool

Has check if an item exists in store

func (*KV[V]) Purge

func (c *KV[V]) Purge()

Purge store

func (*KV[V]) Remove

func (c *KV[V]) Remove(key string)

Remove an item from store

func (*KV[V]) Set

func (c *KV[V]) Set(key string, value V)

Set an item to store

Jump to

Keyboard shortcuts

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