Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchFunc ¶
BatchFunc loads multiple keys and returns their values The returned slice must be the same length as the keys slice
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader batches and caches data loading operations
func NewLoader ¶
func NewLoader(config LoaderConfig, batchFunc BatchFunc) *Loader
NewLoader creates a new DataLoader
type LoaderConfig ¶
type LoaderConfig struct {
// Wait is the duration to wait before dispatching a batch
Wait time.Duration
// MaxBatch is the maximum number of keys to load in a single batch
MaxBatch int
}
LoaderConfig configures a DataLoader
func DefaultLoaderConfig ¶
func DefaultLoaderConfig() LoaderConfig
DefaultLoaderConfig returns default loader configuration
Click to show internal directories.
Click to hide internal directories.