Versions in this module Expand all Collapse all v7 v7.1.0 Sep 7, 2022 Changes in this version + type PanicErrorWrapper struct + func (p *PanicErrorWrapper) Error() string v7.0.0 Apr 11, 2022 Changes in this version + type BatchFunc func(context.Context, []K) []*Result[V] + type Cache interface + Clear func() + Delete func(context.Context, K) bool + Get func(context.Context, K) (Thunk[V], bool) + Set func(context.Context, K, Thunk[V]) + type InMemoryCache struct + func NewCache() *InMemoryCache[K, V] + func (c *InMemoryCache[K, V]) Clear() + func (c *InMemoryCache[K, V]) Delete(ctx context.Context, key K) bool + func (c *InMemoryCache[K, V]) Get(_ context.Context, key K) (Thunk[V], bool) + func (c *InMemoryCache[K, V]) Set(_ context.Context, key K, value Thunk[V]) + type Interface interface + Clear func(context.Context, K) Interface[K, V] + ClearAll func() Interface[K, V] + Load func(context.Context, K) Thunk[V] + LoadMany func(context.Context, []K) ThunkMany[V] + Prime func(ctx context.Context, key K, value V) Interface[K, V] + type Loader struct + func NewBatchedLoader(batchFn BatchFunc[K, V], opts ...Option[K, V]) *Loader[K, V] + func (l *Loader[K, V]) Clear(ctx context.Context, key K) Interface[K, V] + func (l *Loader[K, V]) ClearAll() Interface[K, V] + func (l *Loader[K, V]) Load(originalContext context.Context, key K) Thunk[V] + func (l *Loader[K, V]) LoadMany(originalContext context.Context, keys []K) ThunkMany[V] + func (l *Loader[K, V]) Prime(ctx context.Context, key K, value V) Interface[K, V] + type NoCache struct + func (c *NoCache[K, V]) Clear() + func (c *NoCache[K, V]) Delete(context.Context, K) bool + func (c *NoCache[K, V]) Get(context.Context, K) (Thunk[V], bool) + func (c *NoCache[K, V]) Set(context.Context, K, Thunk[V]) + type NoopTracer struct + func (NoopTracer[K, V]) TraceBatch(ctx context.Context, keys []K) (context.Context, TraceBatchFinishFunc[V]) + func (NoopTracer[K, V]) TraceLoad(ctx context.Context, key K) (context.Context, TraceLoadFinishFunc[V]) + func (NoopTracer[K, V]) TraceLoadMany(ctx context.Context, keys []K) (context.Context, TraceLoadManyFinishFunc[V]) + type Option func(*Loader[K, V]) + func WithBatchCapacity(c int) Option[K, V] + func WithCache(c Cache[K, V]) Option[K, V] + func WithClearCacheOnBatch() Option[K, V] + func WithInputCapacity(c int) Option[K, V] + func WithTracer(tracer Tracer[K, V]) Option[K, V] + func WithWait(d time.Duration) Option[K, V] + type Result struct + Data V + Error error + type ResultMany struct + Data []V + Error []error + type Thunk func() (V, error) + type ThunkMany func() ([]V, []error) + type TraceBatchFinishFunc func([]*Result[V]) + type TraceLoadFinishFunc func(Thunk[V]) + type TraceLoadManyFinishFunc func(ThunkMany[V]) + type Tracer interface + TraceBatch func(ctx context.Context, keys []K) (context.Context, TraceBatchFinishFunc[V]) + TraceLoad func(ctx context.Context, key K) (context.Context, TraceLoadFinishFunc[V]) + TraceLoadMany func(ctx context.Context, keys []K) (context.Context, TraceLoadManyFinishFunc[V]) Other modules containing this package github.com/graph-gophers/dataloader github.com/graph-gophers/dataloader/v6