cache

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LRUCache

type LRUCache struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(size int) *LRUCache

func (*LRUCache) GetAggregate

func (c *LRUCache) GetAggregate(a fes.Aggregate) (fes.Entity, error)

func (*LRUCache) Invalidate

func (c *LRUCache) Invalidate(a fes.Aggregate)

func (*LRUCache) List

func (c *LRUCache) List() []fes.Aggregate

func (*LRUCache) Put

func (c *LRUCache) Put(entity fes.Entity) error

func (*LRUCache) Refresh

func (c *LRUCache) Refresh(key fes.Aggregate)

type LoadingCache

type LoadingCache struct {
	fes.CacheReaderWriter
	// contains filtered or unexported fields
}

LoadingCache looks into a backing data store in case there is a cache miss

func NewLoadingCache

func NewLoadingCache(cache fes.CacheReaderWriter, client fes.Backend, projector fes.Projector) *LoadingCache

func (*LoadingCache) GetAggregate

func (c *LoadingCache) GetAggregate(key fes.Aggregate) (fes.Entity, error)

func (*LoadingCache) List

func (c *LoadingCache) List() []fes.Aggregate

List for a LoadingCache returns the keys of all entities in the cache.

TODO provide option to force fallback or only do quick cache lookup. TODO sync cache with store while you are at it.

func (*LoadingCache) Load

func (c *LoadingCache) Load(key fes.Aggregate) error

func (*LoadingCache) Refresh

func (c *LoadingCache) Refresh(key fes.Aggregate)

type SubscribedCache

type SubscribedCache struct {
	pubsub.Publisher
	fes.CacheReaderWriter
	// contains filtered or unexported fields
}

A SubscribedCache is subscribed to an event emitter

func NewSubscribedCache

func NewSubscribedCache(cache fes.CacheReaderWriter, projector fes.Projector,
	sub *pubsub.Subscription) *SubscribedCache

func (*SubscribedCache) Close

func (uc *SubscribedCache) Close() error

Jump to

Keyboard shortcuts

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