Documentation
¶
Overview ¶
Package quicstream supports stream, based on quic.
Index ¶
- Variables
- func ConnectionLoggerFromContext(ctx context.Context, log *zerolog.Logger) zerolog.Logger
- func IsSeriousError(err error) bool
- func WritePrefix(ctx context.Context, w io.Writer, prefix HandlerPrefix) error
- type ConnInfo
- func MustConnInfo(addr *net.UDPAddr, tlsinsecure bool) ConnInfo
- func MustNewConnInfoFromFullString(s string) ConnInfo
- func NewConnInfo(addr *net.UDPAddr, tlsinsecure bool) (ConnInfo, error)
- func NewConnInfoFromFullString(s string) (ConnInfo, error)
- func NewConnInfoFromStringAddr(s string, tlsinsecure bool) (ci ConnInfo, _ error)
- func UnsafeConnInfo(addr *net.UDPAddr, tlsinsecure bool) ConnInfo
- type ConnInfoDialFunc
- type Connection
- type ConnectionPool
- type ErrorHandler
- type Handler
- type HandlerName
- type HandlerPrefix
- type OpenStreamFunc
- type PrefixHandler
- type Server
- type StreamFunc
- type Streamer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConnectionIDContextKey = util.ContextKey("connection_id") StreamIDContextKey = util.ContextKey("stream_id") )
View Source
var ErrHandlerNotFound = util.NewIDError("handler not found")
View Source
var ErrNetwork = util.NewIDError("network error")
View Source
var ErrOpenStream = util.NewIDError("open stream")
View Source
var PrefixHandlerPrefixContextKey = util.ContextKey("prefix-handler-prefix")
Functions ¶
func IsSeriousError ¶
func WritePrefix ¶
Types ¶
type ConnInfo ¶
type ConnInfo struct {
// contains filtered or unexported fields
}
func (ConnInfo) MarshalText ¶
func (ConnInfo) TLSInsecure ¶
func (*ConnInfo) UnmarshalText ¶
type ConnInfoDialFunc ¶
func NewConnInfoDialFunc ¶
func NewConnInfoDialFunc( quicconfigf func() *quic.Config, tlsconfigf func() *tls.Config, ) ConnInfoDialFunc
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Context ¶
func (c *Connection) Context() context.Context
func (*Connection) ID ¶
func (c *Connection) ID() string
func (*Connection) OpenStream ¶
func (c *Connection) OpenStream(ctx context.Context) (io.Reader, io.WriteCloser, func() error, error)
func (*Connection) Stream ¶
func (c *Connection) Stream(ctx context.Context, f StreamFunc) error
type ConnectionPool ¶
type ConnectionPool struct { Stop func() // contains filtered or unexported fields }
func NewConnectionPool ¶
func NewConnectionPool( size uint64, dialf ConnInfoDialFunc, ) (*ConnectionPool, error)
func (*ConnectionPool) Close ¶
func (c *ConnectionPool) Close(ci ConnInfo) bool
func (*ConnectionPool) CloseAll ¶
func (c *ConnectionPool) CloseAll() error
type ErrorHandler ¶
type HandlerName ¶
type HandlerName string
func (HandlerName) Prefix ¶
func (h HandlerName) Prefix() HandlerPrefix
func (HandlerName) String ¶
func (h HandlerName) String() string
type HandlerPrefix ¶
type HandlerPrefix [32]byte
var ZeroPrefix HandlerPrefix
func HashPrefix ¶
func HashPrefix(s HandlerName) HandlerPrefix
func (HandlerPrefix) String ¶
func (p HandlerPrefix) String() string
type OpenStreamFunc ¶
type PrefixHandler ¶
func NewPrefixHandler ¶
func NewPrefixHandler(errorHandler ErrorHandler) *PrefixHandler
func (*PrefixHandler) Add ¶
func (h *PrefixHandler) Add(name HandlerName, handler Handler) *PrefixHandler
func (*PrefixHandler) SetHandlerFunc ¶
func (h *PrefixHandler) SetHandlerFunc(f func(Handler) Handler)
type Server ¶
type Server struct { *logging.Logging *util.ContextDaemon // contains filtered or unexported fields }
type StreamFunc ¶
Click to show internal directories.
Click to hide internal directories.