loader

package
v0.0.0-...-c7ec203 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadUser

func LoadUser(ctx context.Context, key string) (*model.User, error)

Types

type LoaderCollection

type LoaderCollection struct {
	// contains filtered or unexported fields
}

Collection holds an internal lookup of initialized batch data load functions.

func NewLoaderCollection

func NewLoaderCollection() LoaderCollection

Initialize a lookup map of context keys to batch functions.

When Attach is called on the Collection, the batch functions are used to create new dataloader instances. The instances are attached to the request context at the provided keys.

The keys are then used to extract the dataloader instances from the request context.

func (LoaderCollection) Attach

Jump to

Keyboard shortcuts

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