Documentation
¶
Index ¶
- type Config
- type ConnPool
- func (p *ConnPool) AddInbound(conn *quic.Conn)
- func (p *ConnPool) CloseConnection(addr string)
- func (p *ConnPool) GetConnection(addr string) *quic.Conn
- func (p *ConnPool) GetOrDial(ctx context.Context, addr string) (*quic.Conn, error)
- func (p *ConnPool) Len() int
- func (p *ConnPool) Range(fn func(addr string, conn *quic.Conn) bool)
- type Transport
- func (t *Transport) ConnPool() *ConnPool
- func (t *Transport) DialAddressTimeout(addr memberlist.Address, timeout time.Duration) (net.Conn, error)
- func (t *Transport) DialTimeout(addr string, timeout time.Duration) (net.Conn, error)
- func (t *Transport) FinalAdvertiseAddr(ip string, port int) (net.IP, int, error)
- func (t *Transport) PacketCh() <-chan *memberlist.Packet
- func (t *Transport) RawTransport() *quic.Transport
- func (t *Transport) Shutdown() error
- func (t *Transport) StreamCh() <-chan net.Conn
- func (t *Transport) WriteTo(b []byte, addr string) (time.Time, error)
- func (t *Transport) WriteToAddress(b []byte, addr memberlist.Address) (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BindAddr string
BindPort int
TLS *tls.Config
Logger *log.Logger
MaxIdleTimeout time.Duration
KeepAlivePeriod time.Duration
PacketQueueSize int
StreamQueueSize int
MaxConnectionAge time.Duration
PoolSweepInterval time.Duration
}
Config configures the QUIC transport.
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
ConnPool manages QUIC connections to peers.
func (*ConnPool) AddInbound ¶ added in v0.1.1
AddInbound registers an inbound (or externally established) connection in the pool.
func (*ConnPool) CloseConnection ¶
CloseConnection closes and removes the connection to addr.
func (*ConnPool) GetConnection ¶
GetConnection returns an existing connection to the given address, or nil.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport implements memberlist.Transport and memberlist.NodeAwareTransport over QUIC.
func (*Transport) DialAddressTimeout ¶
func (t *Transport) DialAddressTimeout(addr memberlist.Address, timeout time.Duration) (net.Conn, error)
DialAddressTimeout opens a stream to the given address.
func (*Transport) DialTimeout ¶
DialTimeout opens a stream to the given address.
func (*Transport) FinalAdvertiseAddr ¶
FinalAdvertiseAddr returns the IP and port to advertise.
func (*Transport) PacketCh ¶
func (t *Transport) PacketCh() <-chan *memberlist.Packet
PacketCh returns the channel for inbound packets.
func (*Transport) RawTransport ¶ added in v0.1.1
RawTransport returns the underlying QUIC transport. This is needed for hole punching — outgoing dials must originate from the same UDP socket as the listener so the NAT mapping is preserved.
func (*Transport) WriteToAddress ¶
WriteToAddress sends a packet to the given address.