handler

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound           = errors.New("user not found")
	ErrAuthenticationRequired = errors.New("authentication required")
	ErrClaimsInvalid          = errors.New("claims are invalid")
)

Functions

func NewDataLoaderMiddleware

func NewDataLoaderMiddleware(
	wait time.Duration,
	maxBatch int,
	userService user.Service,
	serverService server.Service,
	peerService peer.Service,
) func(http.Handler) http.Handler

func PeerLoaderFromContext

func PeerLoaderFromContext(ctx context.Context) (*dataloader.Loader[string, *model.Peer], error)

func ServerLoaderFromContext

func ServerLoaderFromContext(ctx context.Context) (*dataloader.Loader[string, *model.Server], error)

func UserLoaderFromContext

func UserLoaderFromContext(ctx context.Context) (*dataloader.Loader[string, *model.User], error)

Types

type AuthenticationHandler

type AuthenticationHandler interface {
	WebsocketMiddleware() func(ctx context.Context, payload transport.InitPayload) (context.Context, *transport.InitPayload, error)
	AuthenticationMiddleware() func(http.Handler) http.Handler
}

func NewAuthenticationMiddleware

func NewAuthenticationMiddleware(authService auth.Service, userService user.Service) AuthenticationHandler

Jump to

Keyboard shortcuts

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