loader

package module
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 2 Imported by: 0

README

Loader

GoDoc Report card

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeysToInt added in v2.0.2

func KeysToInt(slice []interface{}) []int

func KeysToInt64 added in v2.0.2

func KeysToInt64(slice []interface{}) []int64

func KeysToString added in v2.0.2

func KeysToString(slice []interface{}) []string

Types

type Loader

type Loader struct {
	MaxBatch int
	Timeout  time.Duration
	Fn       func(keys []interface{}) (interface{}, error)
	// contains filtered or unexported fields
}

func (*Loader) Load

func (t *Loader) Load(key interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL