cache

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection[T comparable] struct {
	// contains filtered or unexported fields
}

func (*Collection[T]) Items

func (c *Collection[T]) Items() []string

func (*Collection[T]) NewItems

func (c *Collection[T]) NewItems() []string

type CollectionCache

type CollectionCache[T comparable] struct {
	// contains filtered or unexported fields
}

func NewCollectionCache

func NewCollectionCache[T comparable](maxCacheSize int, saveFn saveFn[T]) *CollectionCache[T]

NewCollectionCache creates a new collection cache with the given max cache size.

func (*CollectionCache[T]) AddIDToCollection

func (cc *CollectionCache[T]) AddIDToCollection(key string, collObj T, id string) bool

func (*CollectionCache[T]) Close

func (cc *CollectionCache[T]) Close()

func (*CollectionCache[T]) GetCollection

func (cc *CollectionCache[T]) GetCollection(key string) (T, []string, bool)

func (*CollectionCache[T]) GetCollections

func (cc *CollectionCache[T]) GetCollections() *syncmap.SyncMap[string, *Collection[T]]

func (*CollectionCache[T]) NewCollection

func (cc *CollectionCache[T]) NewCollection(key string, coll T, ids []string)

NewCollection manage the cache for the given collection and the given list of initial ids. If the collection already exists, the ids are added to the existing collection.

Jump to

Keyboard shortcuts

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