package
module
Version:
v2.0.3
Opens a new window with list of versions in this module.
Published: Sep 6, 2021
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Loader

Loader is a generic utility to execute function via batching.
The intent is to reduce the number of calls to your function or method.
Getting started
$ go get github.com/rafaelsq/loader
Usage
See loader_test.go
Documentation
¶
func KeysToInt(slice []interface{}) []int
func KeysToInt64(slice []interface{}) []int64
func KeysToString(slice []interface{}) []string
type Loader struct {
MaxBatch int
Timeout time.Duration
Fn func(keys []interface{}) (interface{}, error)
}
func (t *Loader) Load(key interface{}) (interface{}, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.