Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection holds an internal lookup of initialized batch data load functions.
func Initialize ¶
func Initialize() Collection
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.
type UserResult ¶
UserResult is the (data, error) pair result of loading a specific key.
type UserResults ¶
type UserResults []UserResult
UserResults is a named type, so methods can be attached to []UserResult.
func (UserResults) WithoutErrors ¶
func (results UserResults) WithoutErrors() []model.User
WithoutErrors filters any result pairs with non-nil errors.
Click to show internal directories.
Click to hide internal directories.