Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoValueError = errors.New("<dataloader: no value>")
Functions ¶
This section is empty.
Types ¶
type BatchFunc ¶
type BatchFunc[K comparable, V any] func([]context.Context, []K) map[K]Result[V]
BatchFunc is a function, which when given a slice of keys (string), returns a map of `results` indexed by keys.
The keys passed to this function are guaranteed to be unique.
type Loader ¶
type Loader[K comparable, V any] struct { // contains filtered or unexported fields }
Loader implements the dataloader.Interface.
func NewBatchedLoader ¶
func NewBatchedLoader[K comparable, V any](batchFn BatchFunc[K, V], opts Options) *Loader[K, V]
NewBatchedLoader constructs a new Loader with given options.
Click to show internal directories.
Click to hide internal directories.