mem

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 2 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[T any] struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache[T any]() Cache[T]

func (*Cache[T]) Copy

func (c *Cache[T]) Copy() map[string]T

func (*Cache[T]) Delete

func (c *Cache[T]) Delete(id string) bool

func (*Cache[T]) DeleteUnsafe

func (c *Cache[T]) DeleteUnsafe(id string) (ok bool)

func (*Cache[T]) Get

func (c *Cache[T]) Get(id string) (t T, ok bool)

func (*Cache[T]) OnChange

func (c *Cache[T]) OnChange(onChange func(string, T, bool)) *Cache[T]

func (*Cache[T]) Release

func (c *Cache[T]) Release() (entries map[string]T)

func (*Cache[T]) Set

func (c *Cache[T]) Set(id string, t T)

func (*Cache[T]) SetUnsafe

func (c *Cache[T]) SetUnsafe(id string, t T)

func (*Cache[T]) Size

func (c *Cache[T]) Size() int

Jump to

Keyboard shortcuts

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