memstore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: AGPL-3.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 Store

type Store[keyT comparable, valueT any] struct {
	// contains filtered or unexported fields
}

Store is a thread-safe map.

func New

func New[keyT comparable, valueT any]() *Store[keyT, valueT]

New returns a new Store.

func (*Store[keyT, valueT]) Clear

func (s *Store[keyT, valueT]) Clear()

Clear clears all values from store.

func (*Store[keyT, valueT]) Get

func (s *Store[keyT, valueT]) Get(key keyT) (valueT, bool)

Get returns the value for the given key.

func (*Store[keyT, valueT]) GetAll

func (s *Store[keyT, valueT]) GetAll() []valueT

GetAll returns all values in the store.

func (*Store[keyT, valueT]) Set

func (s *Store[keyT, valueT]) Set(key keyT, value valueT)

Set sets the value for the given key.

Jump to

Keyboard shortcuts

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