Documentation
¶
Index ¶
- type Collection
- type CollectionCache
- func (cc *CollectionCache[T]) AddIDToCollection(key string, collObj T, id string) bool
- func (cc *CollectionCache[T]) Close()
- func (cc *CollectionCache[T]) GetCollection(key string) (T, []string, bool)
- func (cc *CollectionCache[T]) GetCollections() *syncmap.SyncMap[string, *Collection[T]]
- func (cc *CollectionCache[T]) NewCollection(key string, coll T, ids []string)
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.
Click to show internal directories.
Click to hide internal directories.