Documentation ¶
Index ¶
- Variables
- type Dialer
- type DialerOpts
- func (m *DialerOpts) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *DialerOpts) CloneVT() *DialerOpts
- func (this *DialerOpts) EqualMessageVT(thatMsg any) bool
- func (this *DialerOpts) EqualVT(that *DialerOpts) bool
- func (x *DialerOpts) GetAddress() string
- func (x *DialerOpts) GetBackoff() *backoff.Backoff
- func (x *DialerOpts) MarshalJSON() ([]byte, error)
- func (x *DialerOpts) MarshalProtoJSON(s *json.MarshalState)
- func (x *DialerOpts) MarshalProtoText() string
- func (m *DialerOpts) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *DialerOpts) MarshalToVT(dAtA []byte) (int, error)
- func (m *DialerOpts) MarshalVT() (dAtA []byte, err error)
- func (*DialerOpts) ProtoMessage()
- func (x *DialerOpts) Reset()
- func (m *DialerOpts) SizeVT() (n int)
- func (x *DialerOpts) String() string
- func (x *DialerOpts) UnmarshalJSON(b []byte) error
- func (x *DialerOpts) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *DialerOpts) UnmarshalVT(dAtA []byte) error
- func (o *DialerOpts) Validate() error
- type TransportDialer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotTransportDialer is returned if a Transport does not implement TransportDialer. ErrNotTransportDialer = errors.New("transport does not implement a dialer") // ErrEmptyAddress is returned if the address field was empty. ErrEmptyAddress = errors.New("dialer opts address cannot be empty") )
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
Dialer manages a transport dialer.
func NewDialer ¶
func NewDialer( le *logrus.Entry, tptDialer TransportDialer, opts *DialerOpts, peerID peer.ID, address string, ) *Dialer
NewDialer constructs a new Dialer
type DialerOpts ¶
type DialerOpts struct { // Address is the address of the peer, in the format expected by the transport. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // Backoff is the dialing backoff configuration. // Can be empty. Backoff *backoff.Backoff `protobuf:"bytes,2,opt,name=backoff,proto3" json:"backoff,omitempty"` // contains filtered or unexported fields }
DialerOpts contains options relating to dialing a statically configured peer.
func (*DialerOpts) CloneMessageVT ¶ added in v0.15.6
func (m *DialerOpts) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*DialerOpts) CloneVT ¶ added in v0.8.3
func (m *DialerOpts) CloneVT() *DialerOpts
func (*DialerOpts) EqualMessageVT ¶ added in v0.15.6
func (this *DialerOpts) EqualMessageVT(thatMsg any) bool
func (*DialerOpts) EqualVT ¶ added in v0.3.0
func (this *DialerOpts) EqualVT(that *DialerOpts) bool
func (*DialerOpts) GetAddress ¶
func (x *DialerOpts) GetAddress() string
func (*DialerOpts) GetBackoff ¶
func (x *DialerOpts) GetBackoff() *backoff.Backoff
func (*DialerOpts) MarshalJSON ¶ added in v0.29.0
func (x *DialerOpts) MarshalJSON() ([]byte, error)
MarshalJSON marshals the DialerOpts to JSON.
func (*DialerOpts) MarshalProtoJSON ¶ added in v0.29.0
func (x *DialerOpts) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the DialerOpts message to JSON.
func (*DialerOpts) MarshalProtoText ¶ added in v0.29.2
func (x *DialerOpts) MarshalProtoText() string
func (*DialerOpts) MarshalToSizedBufferVT ¶ added in v0.2.0
func (m *DialerOpts) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*DialerOpts) MarshalToVT ¶ added in v0.2.0
func (m *DialerOpts) MarshalToVT(dAtA []byte) (int, error)
func (*DialerOpts) MarshalVT ¶ added in v0.2.0
func (m *DialerOpts) MarshalVT() (dAtA []byte, err error)
func (*DialerOpts) ProtoMessage ¶
func (*DialerOpts) ProtoMessage()
func (*DialerOpts) Reset ¶
func (x *DialerOpts) Reset()
func (*DialerOpts) SizeVT ¶ added in v0.2.0
func (m *DialerOpts) SizeVT() (n int)
func (*DialerOpts) String ¶
func (x *DialerOpts) String() string
func (*DialerOpts) UnmarshalJSON ¶ added in v0.29.0
func (x *DialerOpts) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the DialerOpts from JSON.
func (*DialerOpts) UnmarshalProtoJSON ¶ added in v0.29.0
func (x *DialerOpts) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the DialerOpts message from JSON.
func (*DialerOpts) UnmarshalVT ¶ added in v0.2.0
func (m *DialerOpts) UnmarshalVT(dAtA []byte) error
func (*DialerOpts) Validate ¶ added in v0.36.3
func (o *DialerOpts) Validate() error
Validate validates the dialer options.
type TransportDialer ¶ added in v0.21.0
type TransportDialer interface { // MatchTransportType checks if the given transport type ID matches this transport. // If returns true, the transport controller will call DialPeer with that tptaddr. // E.x.: "udp-quic" or "ws" MatchTransportType(transportType string) bool // GetPeerDialer returns the dialing information for a peer. // Called when resolving EstablishLink. // Return nil, nil to indicate not found or unavailable. GetPeerDialer( ctx context.Context, peerID peer.ID, ) (*DialerOpts, error) // DialPeer dials a peer given an address. The yielded link should be // emitted to the transport handler. DialPeer should return nil if the link // was established. DialPeer will then not be called again for the same peer // ID and address tuple until the yielded link is lost. // // ctx will be canceled once DialPeer returns. use ctx from Execute for long-lived routines. // // Returns fatal and error. DialPeer( ctx context.Context, peerID peer.ID, addr string, ) (lnk link.Link, fatal bool, err error) }
TransportDialer is a transport that supports dialing string-serialized remote addresses. The Transport controller will call Dial if provided an address for the transport, and directed to connect to the peer.
Click to show internal directories.
Click to hide internal directories.