Documentation
¶
Index ¶
- Variables
- func NewHandler(rp RequestProcessor, logf func(error)) http.HandlerFunc
- func NewRequestProcessor[I, O any](reqm RequestMapper[I], resm ResponseMapper[O], ...) *requestProcessor[I, O]
- func ReadJSON(r *http.Request, dst any) error
- func WriteJSON(w io.Writer, r Response) error
- type LoginInput
- type LoginOutput
- type LoginProcessor
- type LoginRequestProcessor
- type RequestMapper
- type RequestMapperFunc
- type RequestProcessor
- type Response
- type ResponseMapper
- type ResponseMapperFunc
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrInternalServer = errors.New("internal server error") )
Functions ¶
func NewHandler ¶
func NewHandler(rp RequestProcessor, logf func(error)) http.HandlerFunc
func NewRequestProcessor ¶
Types ¶
type LoginInput ¶
type LoginInput struct{ EmailAddress string }
type LoginOutput ¶
type LoginOutput struct{ AccessToken string }
type LoginProcessor ¶
type LoginProcessor struct {
// contains filtered or unexported fields
}
func NewLoginProcessor ¶
func NewLoginProcessor() *LoginProcessor
func (*LoginProcessor) Process ¶
func (p *LoginProcessor) Process(ctx context.Context, input LoginInput) (LoginOutput, error)
type LoginRequestProcessor ¶
type LoginRequestProcessor = requestProcessor[LoginInput, LoginOutput]
func NewLoginRequestProcessor ¶
func NewLoginRequestProcessor() *LoginRequestProcessor
type RequestMapperFunc ¶
func NewLoginRequestMapper ¶
func NewLoginRequestMapper() RequestMapperFunc[LoginInput]
func (RequestMapperFunc[I]) MapRequest ¶
type RequestProcessor ¶
type ResponseMapper ¶
type ResponseMapperFunc ¶
func NewLoginResponseMapper ¶
func NewLoginResponseMapper() ResponseMapperFunc[LoginOutput]
func (ResponseMapperFunc[O]) MapResponse ¶
Click to show internal directories.
Click to hide internal directories.