Versions in this module Expand all Collapse all v0 v0.0.2 Jan 4, 2024 v0.0.1 Jan 2, 2024 Changes in this version + const DefaultRequestTimeout + const HeaderRequestTimeout + func GetRequestTimeout(r *http.Request, defaultRequestTimeout time.Duration) (time.Duration, error) + func HttpNotifyHandler(ctx context.Context, handler http.HandlerFunc, event []byte, codec HttpCodec, ...) error + func HttpRequestHandler(ctx context.Context, handler http.HandlerFunc, event []byte, codec HttpCodec, ...) ([]byte, error) + func NewProxyHandler(codec HttpCodec, opts ...ProxyHandlerOption) ws.ProxyHandler + func NewRecoveryHandler(target ws.EventHandler, logger *slog.Logger) ws.EventHandler + func ProxyHttpRequest(conn *ws.Conn, w http.ResponseWriter, r *http.Request, codec HttpCodec, ...) error + type HTTPHandler struct + func NewHTTPHandler(handlerFunc http.HandlerFunc, codec HttpCodec, opts ...HTTPHandlerOption) *HTTPHandler + func (h *HTTPHandler) HandleNotify(ctx context.Context, event []byte) error + func (h *HTTPHandler) HandleRequest(ctx context.Context, event []byte) ([]byte, error) + type HTTPHandlerOption func(*HTTPHandler) + func WithHTTPDefaultRequestTimeout(timeout time.Duration) HTTPHandlerOption + type HttpCodec interface + MessageCodec func() ws.Codec[*message.Message] + RequestCodec func() ws.Codec[*message.EventHTTPRequest] + ResponseCodec func() ws.Codec[*message.EventHTTPResponse] + func NewHttpJsonCodec() HttpCodec + func NewHttpProtoCodec() HttpCodec + type ProxyHandlerOption func(*proxyHandler) + func WithProxyDefaultRequestTimeout(timeout time.Duration) ProxyHandlerOption