Documentation
¶
Index ¶
- Variables
- func NewHandler[T RequestHeader](encs *encoder.Encoders, handler Handler[T], errhandler ErrorHandler) quicstream.Handler
- type BaseHeader
- type BaseHeaderJSONMarshaler
- type BaseRequestHeader
- type BaseResponseHeader
- type BaseResponseHeaderJSONMarshaler
- type BaseResponseHeaderJSONUnmarshaler
- type BodyType
- type BrokerFunc
- type ClientBroker
- func (broker ClientBroker) Close() error
- func (broker ClientBroker) ReadBody(ctx context.Context) (bodyType BodyType, bodyLength uint64, body io.Reader, enc encoder.Encoder, ...)
- func (broker ClientBroker) ReadBodyErr(ctx context.Context) (bodyType BodyType, bodyLength uint64, body io.Reader, _ error)
- func (broker *ClientBroker) ReadResponseHead(ctx context.Context) (enc encoder.Encoder, res ResponseHeader, _ error)
- func (broker ClientBroker) WriteBody(ctx context.Context, bodyType BodyType, bodyLength uint64, body io.Reader) error
- func (broker *ClientBroker) WriteRequestHead(ctx context.Context, header RequestHeader) error
- type DataType
- type DefaultResponseHeader
- type DialFunc
- type ErrorHandler
- type Handler
- type HandlerBroker
- func (broker HandlerBroker) Close() error
- func (broker HandlerBroker) ReadBody(ctx context.Context) (bodyType BodyType, bodyLength uint64, body io.Reader, enc encoder.Encoder, ...)
- func (broker HandlerBroker) ReadBodyErr(ctx context.Context) (bodyType BodyType, bodyLength uint64, body io.Reader, _ error)
- func (broker *HandlerBroker) ReadRequestHead(ctx context.Context) (header RequestHeader, _ error)
- func (broker HandlerBroker) WriteBody(ctx context.Context, bodyType BodyType, bodyLength uint64, body io.Reader) error
- func (broker *HandlerBroker) WriteResponseHead(ctx context.Context, res ResponseHeader) error
- func (broker *HandlerBroker) WriteResponseHeadOK(ctx context.Context, ok bool, err error) error
- type Header
- type ReadBodyBroker
- type RequestHeader
- type ResponseHeader
- type StreamFunc
- type WriteBodyBroker
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultResponseHeaderHint = hint.MustNewHint("quicstream-default-response-header-v0.0.1")
Functions ¶
func NewHandler ¶
func NewHandler[T RequestHeader]( encs *encoder.Encoders, handler Handler[T], errhandler ErrorHandler, ) quicstream.Handler
Types ¶
type BaseHeader ¶
type BaseHeader struct {
hint.BaseHinter
}
func NewBaseHeader ¶
func NewBaseHeader(ht hint.Hint) BaseHeader
func (BaseHeader) IsValid ¶
func (h BaseHeader) IsValid([]byte) error
func (BaseHeader) JSONMarshaler ¶
func (h BaseHeader) JSONMarshaler() BaseHeaderJSONMarshaler
func (BaseHeader) QUICStreamHeader ¶
func (BaseHeader) QUICStreamHeader()
func (*BaseHeader) UnmarshalJSON ¶
func (h *BaseHeader) UnmarshalJSON(b []byte) error
type BaseHeaderJSONMarshaler ¶
type BaseHeaderJSONMarshaler struct {
hint.BaseHinter
}
type BaseRequestHeader ¶
type BaseRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewBaseRequestHeader ¶
func NewBaseRequestHeader(ht hint.Hint, prefix quicstream.HandlerPrefix) BaseRequestHeader
func (BaseRequestHeader) Handler ¶
func (h BaseRequestHeader) Handler() quicstream.HandlerPrefix
func (*BaseRequestHeader) UnmarshalJSON ¶
func (h *BaseRequestHeader) UnmarshalJSON(b []byte) error
type BaseResponseHeader ¶
type BaseResponseHeader struct { BaseHeader // contains filtered or unexported fields }
func NewBaseResponseHeader ¶
func NewBaseResponseHeader(ht hint.Hint, ok bool, err error) BaseResponseHeader
func (BaseResponseHeader) Err ¶
func (r BaseResponseHeader) Err() error
func (BaseResponseHeader) JSONMarshaler ¶
func (r BaseResponseHeader) JSONMarshaler() BaseResponseHeaderJSONMarshaler
func (BaseResponseHeader) OK ¶
func (r BaseResponseHeader) OK() bool
func (*BaseResponseHeader) UnmarshalJSON ¶
func (r *BaseResponseHeader) UnmarshalJSON(b []byte) error
type BaseResponseHeaderJSONMarshaler ¶
type BaseResponseHeaderJSONMarshaler struct { BaseResponseHeaderJSONUnmarshaler BaseHeaderJSONMarshaler }
type BrokerFunc ¶
type BrokerFunc func(context.Context, *ClientBroker) error
type ClientBroker ¶
type ClientBroker struct {
// contains filtered or unexported fields
}
func NewClientBroker ¶
func NewClientBroker( encs *encoder.Encoders, enc encoder.Encoder, r io.Reader, w io.WriteCloser, ) *ClientBroker
func (ClientBroker) ReadBodyErr ¶
func (*ClientBroker) ReadResponseHead ¶
func (broker *ClientBroker) ReadResponseHead(ctx context.Context) (enc encoder.Encoder, res ResponseHeader, _ error)
func (*ClientBroker) WriteRequestHead ¶
func (broker *ClientBroker) WriteRequestHead(ctx context.Context, header RequestHeader) error
type DefaultResponseHeader ¶
type DefaultResponseHeader struct {
BaseResponseHeader
}
func NewDefaultResponseHeader ¶
func NewDefaultResponseHeader(ok bool, err error) DefaultResponseHeader
func (DefaultResponseHeader) MarshalJSON ¶
func (h DefaultResponseHeader) MarshalJSON() ([]byte, error)
func (*DefaultResponseHeader) UnmarshalJSON ¶
func (h *DefaultResponseHeader) UnmarshalJSON(b []byte) error
type DialFunc ¶
type DialFunc func(context.Context, quicstream.ConnInfo) (_ StreamFunc, closeConnection func() error, _ error)
func NewDialFunc ¶
func NewDialFunc( dialf quicstream.ConnInfoDialFunc, encs *encoder.Encoders, enc encoder.Encoder, ) DialFunc
type ErrorHandler ¶
type Handler ¶
type Handler[T RequestHeader] func( context.Context, net.Addr, *HandlerBroker, T, ) (context.Context, error)
type HandlerBroker ¶
type HandlerBroker struct {
// contains filtered or unexported fields
}
func NewHandlerBroker ¶
func (HandlerBroker) ReadBodyErr ¶
func (*HandlerBroker) ReadRequestHead ¶
func (broker *HandlerBroker) ReadRequestHead(ctx context.Context) (header RequestHeader, _ error)
func (*HandlerBroker) WriteResponseHead ¶
func (broker *HandlerBroker) WriteResponseHead(ctx context.Context, res ResponseHeader) error
func (*HandlerBroker) WriteResponseHeadOK ¶
type ReadBodyBroker ¶
type RequestHeader ¶
type RequestHeader interface { Header Handler() quicstream.HandlerPrefix }
type ResponseHeader ¶
type StreamFunc ¶
type StreamFunc func(context.Context, BrokerFunc) error
Click to show internal directories.
Click to hide internal directories.