dataloader

package
v0.0.0-...-a7b4bc4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(loader *DataLoader, next http.Handler) http.Handler

Types

type AdminLoader

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

type DataLoader

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

DataLoader offers data loaders scoped to a context

func For

func For(ctx context.Context) *DataLoader

For returns the dataloader for a given context

func NewDataLoader

func NewDataLoader(client *ent.Client) *DataLoader

NewDataLoader returns the instantiated Loaders struct for use in a request

func (DataLoader) GetPermissionChildrenCount

func (l DataLoader) GetPermissionChildrenCount(ctx context.Context, id int) (int, error)

func (DataLoader) GetUserRoleCount

func (l DataLoader) GetUserRoleCount(ctx context.Context, id int) (int, error)

Jump to

Keyboard shortcuts

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