Documentation
¶
Index ¶
- type ErrorHandler
- type Handler
- type HandlerOption
- func AppendOptions(base []HandlerOption, items ...HandlerOption) []HandlerOption
- func WithErrorEncoder(errorEncoder encoder.ErrorEncoder) HandlerOption
- func WithErrorHandler(errorHandler ErrorHandler) HandlerOption
- func WithOperationName(name string) HandlerOption
- func WithOperationNameFunc(fn func(ctx context.Context) string) HandlerOption
- type HandlerWithArgs
- type RequestDecoder
- type RequestDecoderWithArgs
- type SelfEncodingError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
ErrorHandler receives a transport error to be processed for diagnostic purposes. Usually this means logging the error.
type Handler ¶
type Handler[Request any, Response any] interface { ServeHTTP(w http.ResponseWriter, r *http.Request) Chain(outer operation.Middleware[Request, Response], others ...operation.Middleware[Request, Response]) Handler[Request, Response] }
func NewHandler ¶
func NewHandler[Request any, Response any]( requestDecoder RequestDecoder[Request], op operation.Operation[Request, Response], responseEncoder encoder.ResponseEncoder[Response], options ...HandlerOption, ) Handler[Request, Response]
NewHandler returns a new HTTP handler that wraps the given operation.Operation.
type HandlerOption ¶
type HandlerOption interface {
// contains filtered or unexported methods
}
func AppendOptions ¶
func AppendOptions(base []HandlerOption, items ...HandlerOption) []HandlerOption
func WithErrorEncoder ¶
func WithErrorEncoder(errorEncoder encoder.ErrorEncoder) HandlerOption
func WithErrorHandler ¶
func WithErrorHandler(errorHandler ErrorHandler) HandlerOption
func WithOperationName ¶
func WithOperationName(name string) HandlerOption
func WithOperationNameFunc ¶
func WithOperationNameFunc(fn func(ctx context.Context) string) HandlerOption
type HandlerWithArgs ¶
type HandlerWithArgs[Request any, Response any, ArgType any] interface { With(ArgType) Handler[Request, Response] Chain(outer operation.Middleware[Request, Response], others ...operation.Middleware[Request, Response]) HandlerWithArgs[Request, Response, ArgType] }
func NewHandlerWithArgs ¶
func NewHandlerWithArgs[Request any, Response any, ArgType any]( requestDecoder RequestDecoderWithArgs[Request, ArgType], op operation.Operation[Request, Response], responseEncoder encoder.ResponseEncoder[Response], options ...HandlerOption, ) HandlerWithArgs[Request, Response, ArgType]
type RequestDecoder ¶
type RequestDecoderWithArgs ¶
type SelfEncodingError ¶
type SelfEncodingError interface {
EncodeError(ctx context.Context, w http.ResponseWriter) bool
}
Click to show internal directories.
Click to hide internal directories.