wgin

package
v0.0.0-...-cbbd1a2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SflT

type SflT[S any, T any] func(ctx context.Context, reqCtx web.RequestContext, in S) (T, error)

type SflToHandlerT

type SflToHandlerT[S any, T any] func(SflT[S, T]) gin.HandlerFunc

func MakeLoginHandler

func MakeLoginHandler[S any](
	errorHandler func(any, web.RequestContext) web.ErrorResult,
) SflToHandlerT[S, string]

MakeLoginHandler is a 3rd order function that produces a 2nd order function that takes a login service flow and returns a Gin handler function. Contains common logic to bind the HTTP request to service flow input, call service flow, and produce HTTP responses.

- errorHandler: maps errors before for the HTTP response.

Below are parameters of the function returned by this function:

- sfl: the service flow that is transformed into a Gin HandlerFunc.

func MakeStdFullBodySflHandler

func MakeStdFullBodySflHandler[S any, T any](
	authenticator web.AuthenticatorT,
	authenticationMandatory bool,
	reqCtxExtractor func(*http.Request, *jwt.Token) (web.RequestContext, error),
	errorHandler func(any, web.RequestContext) web.ErrorResult,
) SflToHandlerT[S, T]

func MakeStdNoBodySflHandler

func MakeStdNoBodySflHandler[S any, T any](
	authenticator func(*http.Request) (bool, *jwt.Token, error),
	authenticationMandatory bool,
	reqCtxExtractor func(*http.Request, *jwt.Token) (web.RequestContext, error),
	errorHandler func(any, web.RequestContext) web.ErrorResult,
) SflToHandlerT[S, T]

type SflToMappedHandlerT

type SflToMappedHandlerT[S any, T any] func(
	queryMapper func(map[string]string, *S) error,
	uriMapper func(map[string]string, *S) error,
	svc SflT[S, T],
) gin.HandlerFunc

Directories

Path Synopsis
eg
eg1
eg2

Jump to

Keyboard shortcuts

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