Documentation ¶
Index ¶
- Variables
- func LoadModels[Key comparable, DBModel comparable, GraphModel comparable](ctx context.Context, keys []Key, ...) ([]GraphModel, []error)
- func LoadModelsWithError[Key comparable, DBModel comparable, GraphModel comparable](ctx context.Context, keys []Key, ...) ([]GraphModel, []error)
- func Middleware(fn func(context.Context) context.Context) func(http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDataLoaderOptions = []dataloadgen.Option{ dataloadgen.WithWait(time.Millisecond), dataloadgen.WithBatchCapacity(250), dataloadgen.WithTracer(otel.Tracer("dataloader")), }
View Source
var ErrObjectNotFound = fmt.Errorf("object could not be found: %w", pgx.ErrNoRows)
Functions ¶
func LoadModels ¶
func LoadModels[Key comparable, DBModel comparable, GraphModel comparable]( ctx context.Context, keys []Key, loaderFn func(context.Context, []Key) ([]DBModel, error), toGraphFn func(DBModel) GraphModel, makeKey func(GraphModel) Key, ) ([]GraphModel, []error)
func LoadModelsWithError ¶
func LoadModelsWithError[Key comparable, DBModel comparable, GraphModel comparable]( ctx context.Context, keys []Key, loaderFn func(context.Context, []Key) ([]DBModel, error), toGraphFn func(DBModel) (GraphModel, error), makeKey func(GraphModel) Key, ) ([]GraphModel, []error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.