Documentation
¶
Overview ¶
nolint:ireturn
Index ¶
Constants ¶
View Source
const (
DefaultMaxRequestBodySize = 64 * 1024 * 1024
)
View Source
const (
InternalErrorCode = 500
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Middleware ¶
type Middleware func(next StreamHandler) StreamHandler
func DecodeRequestMiddleware ¶
func DecodeRequestMiddleware() Middleware
func MaxRequestBodySize ¶
func MaxRequestBodySize(maxBytes int64) Middleware
func Recovery ¶
func Recovery() Middleware
type Option ¶
type Option func(*Server)
func WithMiddlewares ¶
func WithMiddlewares(mws ...Middleware) Option
func WithQUICConfig ¶
func WithTLSConfig ¶
type QuicError ¶
type QuicError interface {
ErrorCode() uint64
}
QuicError represents an error that provide error code.
type Request ¶
type Request struct {
Address string `json:"-"`
Timeout time.Duration `json:"-"`
Body json.RawMessage
Headers map[string]string
}
func DecodeRequest ¶
type Response ¶
func DecodeResponse ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func DefaultServer ¶
func (*Server) ListenAndServe ¶
func (*Server) Upgrade ¶
func (s *Server) Upgrade(h StreamHandler)
type Stream ¶
type Stream interface {
StreamID() int64
Read(p []byte) (int, error)
Write(p []byte) (int, error)
CancelWrite(errorCode uint64)
CancelRead(errorCode uint64)
Context() context.Context
Close() error
SetReadDeadline(t time.Time) error
SetWriteDeadline(t time.Time) error
SetDeadline(t time.Time) error
}
type StreamHandler ¶
func ChainMiddleware ¶
func ChainMiddleware(handler StreamHandler, mws ...Middleware) StreamHandler
type StreamHandlerFunc ¶
func (StreamHandlerFunc) HandleStream ¶
func (f StreamHandlerFunc) HandleStream(ctx context.Context, s Stream) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.