Documentation
¶
Index ¶
- Constants
- Variables
- func CloseConn(conn quic.Connection, reason CLOSE_REASON) error
- func DefaultConfig() *quic.Config
- func Ping(writer io.Writer) error
- func Pong(reader io.Reader) error
- func ReadCommand(r io.Reader) (message.Command, error)
- func WriteCommand(w io.Writer, command message.Command) (int, error)
- type Buffer
- type CLOSE_REASON
- type QuicClientTransport
- func (v *QuicClientTransport) Close() error
- func (v *QuicClientTransport) GetStats() string
- func (v *QuicClientTransport) Read(buffer []byte) (int, error)
- func (v *QuicClientTransport) ReadControlCommand() (message.Command, error)
- func (v *QuicClientTransport) RunReaders() error
- func (v *QuicClientTransport) Write(buffer []byte) (int, error)
- func (v *QuicClientTransport) WriteControlCommand(command message.Command) (int, error)
- type QuicConfig
- type QuicServerTransport
- func (v *QuicServerTransport) Close() error
- func (v *QuicServerTransport) GetStats() string
- func (v *QuicServerTransport) Read(buffer []byte) (int, error)
- func (v *QuicServerTransport) ReadControlCommand() (message.Command, error)
- func (v *QuicServerTransport) RunReaders() error
- func (v *QuicServerTransport) Write(buffer []byte) (int, error)
- func (v *QuicServerTransport) WriteControlCommand(command message.Command) (int, error)
- type Transport
Constants ¶
View Source
const STREAMS = 30
Variables ¶
View Source
var REASON_STRING = map[CLOSE_REASON]string{ CLOSE: "graceful shutdown", CONTROL: "control stream can't be openned", }
Functions ¶
func CloseConn ¶
func CloseConn(conn quic.Connection, reason CLOSE_REASON) error
func DefaultConfig ¶
Types ¶
type Buffer ¶
func WrapBuffer ¶
type CLOSE_REASON ¶
type CLOSE_REASON int
const CLOSE CLOSE_REASON = 0
const CONTROL CLOSE_REASON = 1
type QuicClientTransport ¶
type QuicClientTransport struct { Conn quic.Connection Streams []quic.Stream ControlStream quic.Stream BufferChannel chan Buffer BufferPool *pool.Pool[[]byte] }
func (*QuicClientTransport) Close ¶
func (v *QuicClientTransport) Close() error
func (*QuicClientTransport) GetStats ¶
func (v *QuicClientTransport) GetStats() string
func (*QuicClientTransport) Read ¶
func (v *QuicClientTransport) Read(buffer []byte) (int, error)
Read may read from a random channel by order of insertion
func (*QuicClientTransport) ReadControlCommand ¶
func (v *QuicClientTransport) ReadControlCommand() (message.Command, error)
func (*QuicClientTransport) RunReaders ¶
func (v *QuicClientTransport) RunReaders() error
func (*QuicClientTransport) Write ¶
func (v *QuicClientTransport) Write(buffer []byte) (int, error)
Write write to a random channel
func (*QuicClientTransport) WriteControlCommand ¶
func (v *QuicClientTransport) WriteControlCommand(command message.Command) (int, error)
type QuicConfig ¶
func (QuicConfig) GenerateTLSConfig ¶
func (v QuicConfig) GenerateTLSConfig(is_server bool) *tls.Config
type QuicServerTransport ¶
type QuicServerTransport struct { Listener quic.Listener Conn quic.Connection Streams []quic.Stream ControlStream quic.Stream BufferChannel chan Buffer BufferPool *pool.Pool[[]byte] }
func (*QuicServerTransport) Close ¶
func (v *QuicServerTransport) Close() error
func (*QuicServerTransport) GetStats ¶
func (v *QuicServerTransport) GetStats() string
func (*QuicServerTransport) Read ¶
func (v *QuicServerTransport) Read(buffer []byte) (int, error)
Read may read from a random channel by order of insertion
func (*QuicServerTransport) ReadControlCommand ¶
func (v *QuicServerTransport) ReadControlCommand() (message.Command, error)
func (*QuicServerTransport) RunReaders ¶
func (v *QuicServerTransport) RunReaders() error
Sync functino to perform all reading. When it returns, all streams are closed
func (*QuicServerTransport) Write ¶
func (v *QuicServerTransport) Write(buffer []byte) (int, error)
Write write to a random channel
func (*QuicServerTransport) WriteControlCommand ¶
func (v *QuicServerTransport) WriteControlCommand(command message.Command) (int, error)
Click to show internal directories.
Click to hide internal directories.