Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConnectTimeout = time.Second * 10 RTTMeasureInterval = time.Second * 3 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ClientTransport ¶
type ClientTransport interface { Transport WithClientCertificate(cert tls.Certificate) error }
type DatagramDelegate ¶
type StreamDelegate ¶
type StreamDelegate struct { net.Conn // The backing bytes stream of the delegation Certificate *x509.Certificate // The verified peer certificate, if any Identity *protocol.Node // The identity that the peer claims to be. Implementation may use mTLS to verify Kind protocol.Stream_Type // Type of the bytes stream of the delegation }
type StreamHandler ¶
type StreamHandler func(delegate *StreamDelegate)
type StreamRouter ¶
type StreamRouter struct {
// contains filtered or unexported fields
}
func NewStreamRouter ¶
func NewStreamRouter(logger *zap.Logger, chordTransport, tunnelTransport Transport) *StreamRouter
func (*StreamRouter) Accept ¶
func (s *StreamRouter) Accept(ctx context.Context)
func (*StreamRouter) HandleChord ¶
func (s *StreamRouter) HandleChord(kind protocol.Stream_Type, target *protocol.Node, handler StreamHandler)
func (*StreamRouter) HandleTunnel ¶
func (s *StreamRouter) HandleTunnel(kind protocol.Stream_Type, handler StreamHandler)
type Transport ¶
type Transport interface { Identity() *protocol.Node DialStream(ctx context.Context, peer *protocol.Node, kind protocol.Stream_Type) (net.Conn, error) AcceptStream() <-chan *StreamDelegate ListConnected() []ConnectedPeer SupportDatagram() bool ReceiveDatagram() <-chan *DatagramDelegate SendDatagram(*protocol.Node, []byte) error }
Click to show internal directories.
Click to hide internal directories.