cache

package
v0.24.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 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] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Cache is a set of unique keys of type K.

func NewCache

func NewCache[K comparable]() *Cache[K]

NewCache returns new instance of cache.

func Provide

func Provide[K comparable]() *Cache[K]

Provide cache.

func (*Cache[K]) GetAll added in v0.23.0

func (c *Cache[K]) GetAll() []K

GetAll returns a copy of current state of cache.

State is returned as a list in an arbitrary order.

func (*Cache[K]) Put

func (c *Cache[K]) Put(k K)

Put inserts k into the cache.

Jump to

Keyboard shortcuts

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