Documentation ¶
Index ¶
- type AsyncFetcher
- type KeylessFetcher
- type KeylessRecordCache
- func NewKeylessRecordCacheAsync[V any](driver driver.Cache[int, RecordCacheItem[V]], f KeylessFetcher[V], ...) *KeylessRecordCache[V]
- func NewKeylessRecordCacheAsyncWithLogger[V any](driver driver.Cache[int, RecordCacheItem[V]], f KeylessFetcher[V], ...) *KeylessRecordCache[V]
- func NewKeylessRecordCacheOnDemand[V any](driver driver.Cache[int, RecordCacheItem[V]], f KeylessFetcher[V], ...) *KeylessRecordCache[V]
- type OnDemandFetcher
- type RecordCache
- func (r *RecordCache[K, V]) AddLogger(l *zap.Logger) *RecordCache[K, V]
- func (r *RecordCache[K, V]) Get(ctx context.Context, k K) (V, error)
- func (r *RecordCache[K, V]) SetAsyncFetcher(f AsyncFetcher[K, V], ttl time.Duration) *RecordCache[K, V]
- func (r *RecordCache[K, V]) SetOnDemandFetcher(f OnDemandFetcher[K, V], ttl time.Duration) *RecordCache[K, V]
- type RecordCacheItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncFetcher ¶
type AsyncFetcher[K comparable, V any] interface { FetchAll(ctx context.Context) (map[K]V, error) }
type KeylessFetcher ¶
type KeylessRecordCache ¶
type KeylessRecordCache[V any] struct { *RecordCache[int, V] }
KeylessRecordCache to allow rotation of a cache with only one value a prime use case being a token cache for a service like salesforce
func NewKeylessRecordCacheAsync ¶
func NewKeylessRecordCacheAsync[V any](driver driver.Cache[int, RecordCacheItem[V]], f KeylessFetcher[V], ttl time.Duration) *KeylessRecordCache[V]
func NewKeylessRecordCacheAsyncWithLogger ¶
func NewKeylessRecordCacheAsyncWithLogger[V any](driver driver.Cache[int, RecordCacheItem[V]], f KeylessFetcher[V], ttl time.Duration, log *zap.Logger) *KeylessRecordCache[V]
func NewKeylessRecordCacheOnDemand ¶
func NewKeylessRecordCacheOnDemand[V any](driver driver.Cache[int, RecordCacheItem[V]], f KeylessFetcher[V], ttl time.Duration) *KeylessRecordCache[V]
type OnDemandFetcher ¶
type OnDemandFetcher[K comparable, V any] interface { FetchByKey(ctx context.Context, k K) (V, error) }
type RecordCache ¶
type RecordCache[K comparable, V any] struct { // contains filtered or unexported fields }
RecordCache for a detailed explanation of the below, RecordCacheItem, KeylessRecordCache and driver.Cache please see https://ellogroup.atlassian.net/wiki/spaces/EP/pages/12648450/Cache+Package
func NewRecordCache ¶
func NewRecordCache[K comparable, V any](cache driver.Cache[K, RecordCacheItem[V]]) *RecordCache[K, V]
func (*RecordCache[K, V]) AddLogger ¶
func (r *RecordCache[K, V]) AddLogger(l *zap.Logger) *RecordCache[K, V]
func (*RecordCache[K, V]) Get ¶
func (r *RecordCache[K, V]) Get(ctx context.Context, k K) (V, error)
func (*RecordCache[K, V]) SetAsyncFetcher ¶
func (r *RecordCache[K, V]) SetAsyncFetcher(f AsyncFetcher[K, V], ttl time.Duration) *RecordCache[K, V]
func (*RecordCache[K, V]) SetOnDemandFetcher ¶
func (r *RecordCache[K, V]) SetOnDemandFetcher(f OnDemandFetcher[K, V], ttl time.Duration) *RecordCache[K, V]
Click to show internal directories.
Click to hide internal directories.