middleware

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanExceedLimit

func CanExceedLimit(ctx context.Context) bool

func DataLoaderFromContext

func DataLoaderFromContext(ctx context.Context) *dataloader.DataLoader

func LimitWhitelist

func LimitWhitelist(cfg LimitWhitelistConfig) gin.HandlerFunc

func ServerDataLoadersFromContext

func ServerDataLoadersFromContext(ctx context.Context) map[string]*dataloader.ServerDataLoader

func StoreDataLoaderInContext

func StoreDataLoaderInContext(ctx context.Context, loaders *dataloader.DataLoader) context.Context

func StoreLimitWhitelistDataInContext

func StoreLimitWhitelistDataInContext(ctx context.Context, canExceedLimit bool) context.Context

func StoreServerDataLoadersInContext

func StoreServerDataLoadersInContext(ctx context.Context, loaders map[string]*dataloader.ServerDataLoader) context.Context

func StoreVersionDataLoadersInContext

func StoreVersionDataLoadersInContext(ctx context.Context, loaders map[twmodel.VersionCode]*dataloader.VersionDataLoader) context.Context

Types

type ContextKey

type ContextKey string

type DataLoadersToContextConfig

type DataLoadersToContextConfig struct {
	ServerRepo server.Repository
}

type LimitWhitelistConfig

type LimitWhitelistConfig struct {
	IPAddresses []string
}

Jump to

Keyboard shortcuts

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