Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchLoader ¶
type DataLoader ¶
func NewDataLoader ¶
func NewDataLoader[K string, T any](ctx context.Context, batchLoader BatchLoader[K, T], maxBatchSize int32, maxBatchTimeMs int32) *DataLoader[K, T]
func (*DataLoader[K, T]) Load ¶
func (d *DataLoader[K, T]) Load(key K) (*T, error)
Load retrieves a value for a given key. If the value is not already cached, the loader will call the batch function with a list of keys.
func (*DataLoader[K, T]) LoadMany ¶
func (d *DataLoader[K, T]) LoadMany(keys *[]K) ([]*T, error)
LoadMany retrieves multiple values for a given list of keys. For each key that is not already cached, a single loader call will be scheduled.
Click to show internal directories.
Click to hide internal directories.