pconn

package
v0.30.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link = transport_quic.Link

Link is a Quic-based connection/link backed by a packet connection.

type Opts

type Opts struct {

	// Quic are the quic protocol options.
	Quic *quic.Opts `protobuf:"bytes,1,opt,name=quic,proto3" json:"quic,omitempty"`
	// Verbose turns on verbose debug logging.
	Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"`
	// contains filtered or unexported fields
}

Opts are extra options for the packet conn.

func (*Opts) CloneMessageVT added in v0.15.6

func (m *Opts) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Opts) CloneVT added in v0.8.3

func (m *Opts) CloneVT() *Opts

func (*Opts) EqualMessageVT added in v0.15.6

func (this *Opts) EqualMessageVT(thatMsg any) bool

func (*Opts) EqualVT added in v0.3.0

func (this *Opts) EqualVT(that *Opts) bool

func (*Opts) GetQuic

func (x *Opts) GetQuic() *quic.Opts

func (*Opts) GetVerbose

func (x *Opts) GetVerbose() bool

func (*Opts) MarshalJSON added in v0.29.0

func (x *Opts) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Opts to JSON.

func (*Opts) MarshalProtoJSON added in v0.29.0

func (x *Opts) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Opts message to JSON.

func (*Opts) MarshalProtoText added in v0.29.2

func (x *Opts) MarshalProtoText() string

func (*Opts) MarshalToSizedBufferVT added in v0.2.0

func (m *Opts) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Opts) MarshalToVT added in v0.2.0

func (m *Opts) MarshalToVT(dAtA []byte) (int, error)

func (*Opts) MarshalVT added in v0.2.0

func (m *Opts) MarshalVT() (dAtA []byte, err error)

func (*Opts) ProtoMessage

func (*Opts) ProtoMessage()

func (*Opts) Reset

func (x *Opts) Reset()

func (*Opts) SizeVT added in v0.2.0

func (m *Opts) SizeVT() (n int)

func (*Opts) String

func (x *Opts) String() string

func (*Opts) UnmarshalJSON added in v0.29.0

func (x *Opts) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Opts from JSON.

func (*Opts) UnmarshalProtoJSON added in v0.29.0

func (x *Opts) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Opts message from JSON.

func (*Opts) UnmarshalVT added in v0.2.0

func (m *Opts) UnmarshalVT(dAtA []byte) error

type Transport

type Transport struct {
	// Transport is the underlying quic transport
	*transport_quic.Transport
	// contains filtered or unexported fields
}

Transport implements a bifrost transport with a Quic-based packet conn. Transport UUIDs are deterministic and based on the LocalAddr() of the pconn.

func NewTransport

func NewTransport(
	ctx context.Context,
	le *logrus.Entry,
	privKey crypto.PrivKey,
	tc transport.TransportHandler,
	opts *Opts,

	uuid uint64,

	pc net.PacketConn,

	addrParser func(addr string) (net.Addr, error),

	staticPeerMap map[string]*dialer.DialerOpts,
) (*Transport, error)

NewTransport constructs a new packet-conn based transport.

func (*Transport) Close

func (t *Transport) Close() error

Close closes the transport, returning any errors closing.

func (*Transport) Execute

func (t *Transport) Execute(ctx context.Context) error

Execute executes the transport as configured, returning any fatal error.

func (*Transport) GetPeerDialer added in v0.21.0

func (t *Transport) GetPeerDialer(ctx context.Context, peerID peer.ID) (*dialer.DialerOpts, error)

GetPeerDialer returns the dialing information for a peer. Called when resolving EstablishLink. Return nil, nil to indicate not found or unavailable.

func (*Transport) GetPeerID

func (t *Transport) GetPeerID() peer.ID

GetPeerID returns the peer ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL