loaders

package
v0.0.0-...-7953320 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextWithLoaders

func GetContextWithLoaders(ctx context.Context, apiClients LoaderClients) context.Context

Types

type DataLoaders

type DataLoaders struct {
	SomeEntitiesByIDLoader  ListSomeEntitiesResponse_SomeEntityLoader
	SomeEntitiesByAIDLoader ListSomeEntitiesResponse_SomeEntitySliceLoader
}

func GetDataLoadersFromContext

func GetDataLoadersFromContext(ctx context.Context) *DataLoaders

type ListSomeEntitiesResponse_SomeEntityLoader

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

ListSomeEntitiesResponse_SomeEntityLoader batches and caches requests

func (*ListSomeEntitiesResponse_SomeEntityLoader) Clear

Clear the value at key from the cache, if it exists

func (*ListSomeEntitiesResponse_SomeEntityLoader) Load

Load a listSomeEntitiesResponse_SomeEntity by key, batching and caching will be applied automatically

func (*ListSomeEntitiesResponse_SomeEntityLoader) LoadAll

LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured

func (*ListSomeEntitiesResponse_SomeEntityLoader) LoadAllThunk

LoadThunk returns a function that when called will block waiting for a listSomeEntitiesResponse_SomeEntitys. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.

func (*ListSomeEntitiesResponse_SomeEntityLoader) LoadThunk

LoadThunk returns a function that when called will block waiting for a listSomeEntitiesResponse_SomeEntity. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.

func (*ListSomeEntitiesResponse_SomeEntityLoader) Prime

Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)

type ListSomeEntitiesResponse_SomeEntitySliceLoader

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

ListSomeEntitiesResponse_SomeEntitySliceLoader batches and caches requests

func (*ListSomeEntitiesResponse_SomeEntitySliceLoader) Clear

Clear the value at key from the cache, if it exists

func (*ListSomeEntitiesResponse_SomeEntitySliceLoader) Load

Load a listSomeEntitiesResponse_SomeEntity by key, batching and caching will be applied automatically

func (*ListSomeEntitiesResponse_SomeEntitySliceLoader) LoadAll

LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured

func (*ListSomeEntitiesResponse_SomeEntitySliceLoader) LoadAllThunk

LoadThunk returns a function that when called will block waiting for a listSomeEntitiesResponse_SomeEntitys. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.

func (*ListSomeEntitiesResponse_SomeEntitySliceLoader) LoadThunk

LoadThunk returns a function that when called will block waiting for a listSomeEntitiesResponse_SomeEntity. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.

func (*ListSomeEntitiesResponse_SomeEntitySliceLoader) Prime

Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)

type LoaderClients

type LoaderClients interface {
	GetServiceExampleClient() proto.ServiceExampleClient
}

Jump to

Keyboard shortcuts

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