Documentation
¶
Index ¶
- Constants
- func NewCertPool(caFile string) (*x509.CertPool, error)
- func NewTlsConfig(keyFile, certFile, caFile string) *tls.Config
- type Any
- type Binder
- type Client
- func (c *Client) Connect() error
- func (c *Client) DeregisterMessageHandler(messageType MessageType)
- func (c *Client) Disconnect() error
- func (c *Client) RegisterMessageHandler(messageType MessageType, handler ClientMessageHandler, binder Binder)
- func (c *Client) SendMessage(messageType int, message interface{}) error
- func (c *Client) SendRawData(data []byte) error
- type ClientHandlerData
- type ClientMessageHandler
- type ClientMessageHandlerMap
- type ClientOption
- type ConnectHandler
- type ConnectionError
- type ErrorCode
- type HandlerData
- type Message
- type MessageHandler
- type MessageHandlerMap
- type MessagePayload
- type MessageType
- type ReceiveStream
- type SendStream
- type Server
- func (s *Server) DeregisterMessageHandler(messageType MessageType)
- func (s *Server) Endpoint() (*url.URL, error)
- func (s *Server) RegisterMessageHandler(messageType MessageType, handler MessageHandler, binder Binder)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) Stop(ctx context.Context) error
- type ServerOption
- func WithAddress(addr string) ServerOption
- func WithCodec(c string) ServerOption
- func WithConnectHandle(h ConnectHandler) ServerOption
- func WithKeepAlivePeriod(timeout time.Duration) ServerOption
- func WithMaxIdleTimeout(timeout time.Duration) ServerOption
- func WithPath(path string) ServerOption
- func WithTLSConfig(c *tls.Config) ServerOption
- func WithTimeout(timeout time.Duration) ServerOption
- type Session
- func (c *Session) AcceptStream(ctx context.Context) (Stream, error)
- func (c *Session) AcceptUniStream(ctx context.Context) (ReceiveStream, error)
- func (c *Session) Close() error
- func (c *Session) Context() context.Context
- func (c *Session) LocalAddr() net.Addr
- func (c *Session) OpenStream() (Stream, error)
- func (c *Session) OpenStreamSync(ctx context.Context) (stream Stream, err error)
- func (c *Session) OpenUniStream() (SendStream, error)
- func (c *Session) OpenUniStreamSync(ctx context.Context) (stream SendStream, err error)
- func (c *Session) RemoteAddr() net.Addr
- func (c *Session) SessionID() SessionID
- type SessionID
- type Stream
- type StreamError
- type Upgrader
Constants ¶
View Source
const WebTransportBufferedStreamRejectedErrorCode quic.StreamErrorCode = 0x3994bd84
WebTransportBufferedStreamRejectedErrorCode is the error code of the H3_WEBTRANSPORT_BUFFERED_STREAM_REJECTED error.
Variables ¶
This section is empty.
Functions ¶
func NewTlsConfig ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
func (*Client) DeregisterMessageHandler ¶
func (c *Client) DeregisterMessageHandler(messageType MessageType)
func (*Client) Disconnect ¶
func (*Client) RegisterMessageHandler ¶
func (c *Client) RegisterMessageHandler(messageType MessageType, handler ClientMessageHandler, binder Binder)
func (*Client) SendMessage ¶
func (*Client) SendRawData ¶
type ClientHandlerData ¶
type ClientHandlerData struct { Handler ClientMessageHandler Binder Binder }
type ClientMessageHandler ¶
type ClientMessageHandler func(MessagePayload) error
type ClientMessageHandlerMap ¶
type ClientMessageHandlerMap map[MessageType]ClientHandlerData
type ClientOption ¶
type ClientOption func(*Client)
func WithClientCodec ¶
func WithClientCodec(c string) ClientOption
func WithClientKeepAlivePeriod ¶
func WithClientKeepAlivePeriod(timeout time.Duration) ClientOption
func WithClientMaxIdleTimeout ¶
func WithClientMaxIdleTimeout(timeout time.Duration) ClientOption
func WithClientTLSConfig ¶
func WithClientTLSConfig(c *tls.Config) ClientOption
func WithEndpoint ¶
func WithEndpoint(url string) ClientOption
type ConnectHandler ¶
type ConnectionError ¶
ConnectionError is a WebTransport connection error.
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
type HandlerData ¶
type HandlerData struct { Handler MessageHandler Binder Binder }
type Message ¶
type Message struct { Type MessageType Body []byte }
type MessageHandler ¶
type MessageHandler func(SessionID, MessagePayload) error
type MessageHandlerMap ¶
type MessageHandlerMap map[MessageType]HandlerData
type MessagePayload ¶
type MessagePayload Any
type MessageType ¶
type MessageType uint32
type ReceiveStream ¶
type SendStream ¶
type Server ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) DeregisterMessageHandler ¶
func (s *Server) DeregisterMessageHandler(messageType MessageType)
func (*Server) RegisterMessageHandler ¶
func (s *Server) RegisterMessageHandler(messageType MessageType, handler MessageHandler, binder Binder)
type ServerOption ¶
type ServerOption func(*Server)
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithCodec ¶
func WithCodec(c string) ServerOption
func WithConnectHandle ¶
func WithConnectHandle(h ConnectHandler) ServerOption
func WithKeepAlivePeriod ¶
func WithKeepAlivePeriod(timeout time.Duration) ServerOption
func WithMaxIdleTimeout ¶
func WithMaxIdleTimeout(timeout time.Duration) ServerOption
func WithPath ¶
func WithPath(path string) ServerOption
func WithTLSConfig ¶
func WithTLSConfig(c *tls.Config) ServerOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ServerOption
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) AcceptUniStream ¶
func (c *Session) AcceptUniStream(ctx context.Context) (ReceiveStream, error)
func (*Session) OpenStream ¶
func (*Session) OpenStreamSync ¶
func (*Session) OpenUniStream ¶
func (c *Session) OpenUniStream() (SendStream, error)
func (*Session) OpenUniStreamSync ¶
func (c *Session) OpenUniStreamSync(ctx context.Context) (stream SendStream, err error)
func (*Session) RemoteAddr ¶
type Stream ¶
type Stream interface { SendStream ReceiveStream SetDeadline(time.Time) error }
type StreamError ¶
type StreamError struct {
ErrorCode ErrorCode
}
StreamError is the error that is returned from qStream operations (Read, Write) when the qStream is canceled.
func (*StreamError) Error ¶
func (e *StreamError) Error() string
func (*StreamError) Is ¶
func (e *StreamError) Is(target error) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.