Documentation ¶
Index ¶
- type SflT
- type SflToHandlerT
- func MakeLoginHandler[S any](errorHandler func(any, web.RequestContext) web.ErrorResult) SflToHandlerT[S, string]
- func MakeStdFullBodySflHandler[S any, T any](authenticator web.AuthenticatorT, authenticationMandatory bool, ...) SflToHandlerT[S, T]
- func MakeStdNoBodySflHandler[S any, T any](authenticator func(*http.Request) (bool, *jwt.Token, error), ...) SflToHandlerT[S, T]
- type SflToMappedHandlerT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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]
Click to show internal directories.
Click to hide internal directories.