Documentation ¶
Index ¶
- func NewOKReply[Resp Response](value Resp) responseWithStatus[Resp]
- func Wrap[Req any, Resp any, ReqPtr PtrToRequest[Req], RespPtr PtrToResponse[Resp]](handler Handler[Req, Resp, ReqPtr, RespPtr], errTranslator ErrorTranslator, ...) http.HandlerFunc
- type ErrorHandler
- type ErrorHandlerFunc
- type ErrorTranslator
- type ErrorTranslatorFunc
- type Handler
- type PtrToRequest
- type PtrToResponse
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOKReply ¶
func NewOKReply[Resp Response](value Resp) responseWithStatus[Resp]
func Wrap ¶
func Wrap[Req any, Resp any, ReqPtr PtrToRequest[Req], RespPtr PtrToResponse[Resp]](handler Handler[Req, Resp, ReqPtr, RespPtr], errTranslator ErrorTranslator, errHandler ErrorHandler) http.HandlerFunc
Types ¶
type ErrorHandler ¶
type ErrorHandler interface {
HandleError(error)
}
type ErrorHandlerFunc ¶
type ErrorHandlerFunc func(error)
func (ErrorHandlerFunc) HandleError ¶
func (f ErrorHandlerFunc) HandleError(err error)
type ErrorTranslator ¶
type ErrorTranslatorFunc ¶
func (ErrorTranslatorFunc) TranslateError ¶
func (f ErrorTranslatorFunc) TranslateError(err error) uint
type Handler ¶
type Handler[Req any, Resp any, ReqPtr PtrToRequest[Req], RespPtr PtrToResponse[Resp]] func(context.Context, *Req) (*Resp, error)
func (Handler[Req, Rep, ReqPtr, RespPtr]) ToHTTPHandler ¶
func (h Handler[Req, Rep, ReqPtr, RespPtr]) ToHTTPHandler(errTranslator ErrorTranslator, errHandler ErrorHandler) http.HandlerFunc
type PtrToRequest ¶
type PtrToResponse ¶
type Request ¶
type Request interface { easyjson.Unmarshaler }
Click to show internal directories.
Click to hide internal directories.