loaders

package
v0.0.0-...-20fe128 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadersKey = ctxKey("dataLoaders")
)

Variables

This section is empty.

Functions

func GetMayReports

func GetMayReports(ctx context.Context, reportsKeys []string) ([]*commons.PageResult[cModel.Report], error)

GetMayReports returns many reports by reportsKeys efficiently

func GetReports

func GetReports(ctx context.Context, reportsKey string) (*commons.PageResult[cModel.Report], error)

GetReports returns single reports by reportsKey efficiently

Types

type Loaders

Loaders wrap your data loaders to inject via middleware

func For

func For(ctx context.Context) *Loaders

For returns the dataloader for a given context

func NewLoaders

func NewLoaders(
	reportRepository *repository.ReportRepository,
	voucherRepository *repository.VoucherRepository,
	noticeRepository *repository.NoticeRepository,
	inputRepository *repository.InputRepository,
) *Loaders

NewLoaders instantiates data loaders for the middleware

Jump to

Keyboard shortcuts

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