Versions in this module Expand all Collapse all v1 v1.0.3 Nov 25, 2018 v1.0.0 Sep 5, 2018 Changes in this version + type BatchFunc func(context.Context, Keys) []*Result + type Cache interface + Clear func() + Delete func(context.Context, Key) bool + Get func(context.Context, Key) (Thunk, bool) + Set func(context.Context, Key, Thunk) + type InMemoryCache struct + func NewCache() *InMemoryCache + func (c *InMemoryCache) Clear() + func (c *InMemoryCache) Delete(_ context.Context, key Key) bool + func (c *InMemoryCache) Get(_ context.Context, key Key) (Thunk, bool) + func (c *InMemoryCache) Set(_ context.Context, key Key, value Thunk) + type Interface interface + Clear func(context.Context, Key) Interface + ClearAll func() Interface + Load func(context.Context, Key) Thunk + LoadMany func(context.Context, Keys) ThunkMany + Prime func(ctx context.Context, key Key, value interface{}) Interface + type Key interface + Raw func() interface{} + String func() string + type Keys []Key + func NewKeysFromStrings(strings []string) Keys + func (l Keys) Keys() []string + type Loader struct + func NewBatchedLoader(batchFn BatchFunc, opts ...Option) *Loader + func (l *Loader) Clear(ctx context.Context, key Key) Interface + func (l *Loader) ClearAll() Interface + func (l *Loader) Load(originalContext context.Context, key Key) Thunk + func (l *Loader) LoadMany(originalContext context.Context, keys Keys) ThunkMany + func (l *Loader) Prime(ctx context.Context, key Key, value interface{}) Interface + type NoCache struct + func (c *NoCache) Clear() + func (c *NoCache) Delete(context.Context, Key) bool + func (c *NoCache) Get(context.Context, Key) (Thunk, bool) + func (c *NoCache) Set(context.Context, Key, Thunk) + type NoopTracer struct + func (NoopTracer) TraceBatch(ctx context.Context, keys Keys) (context.Context, TraceBatchFinishFunc) + func (NoopTracer) TraceLoad(ctx context.Context, key Key) (context.Context, TraceLoadFinishFunc) + func (NoopTracer) TraceLoadMany(ctx context.Context, keys Keys) (context.Context, TraceLoadManyFinishFunc) + type OpenTracingTracer struct + func (OpenTracingTracer) TraceBatch(ctx context.Context, keys Keys) (context.Context, TraceBatchFinishFunc) + func (OpenTracingTracer) TraceLoad(ctx context.Context, key Key) (context.Context, TraceLoadFinishFunc) + func (OpenTracingTracer) TraceLoadMany(ctx context.Context, keys Keys) (context.Context, TraceLoadManyFinishFunc) + type Option func(*Loader) + func WithBatchCapacity(c int) Option + func WithCache(c Cache) Option + func WithClearCacheOnBatch() Option + func WithInputCapacity(c int) Option + func WithOpenTracingTracer() Option + func WithTracer(tracer Tracer) Option + func WithWait(d time.Duration) Option + type Result struct + Data interface{} + Error error + type ResultMany struct + Data []interface{} + Error []error + type StringKey string + func (k StringKey) Raw() interface{} + func (k StringKey) String() string + type Thunk func() (interface{}, error) + type ThunkMany func() ([]interface{}, []error) + type TraceBatchFinishFunc func([]*Result) + type TraceLoadFinishFunc func(Thunk) + type TraceLoadManyFinishFunc func(ThunkMany) + type Tracer interface + TraceBatch func(ctx context.Context, keys Keys) (context.Context, TraceBatchFinishFunc) + TraceLoad func(ctx context.Context, key Key) (context.Context, TraceLoadFinishFunc) + TraceLoadMany func(ctx context.Context, keys Keys) (context.Context, TraceLoadManyFinishFunc)