Documentation
¶
Index ¶
Constants ¶
const TptAddrDelimiter = '|'
TptAddrDelimiter is the delimiter for tpt addr sections.
Variables ¶
var ErrInvalidTptAddr = errors.New("invalid transport address: expected transport-type-id|addr")
ErrInvalidTptAddr is returned if the tptaddr was invalid.
Functions ¶
func ParseTptAddr ¶
ParseTptAddr parses a transport address string.
Types ¶
type DialTptAddr ¶
type DialTptAddr interface {
// Directive indicates DialTptAddr is a directive.
directive.Directive
// DialTptAddr returns the transport addr to dial.
// usually {transport-type-id}|{addr}
// Cannot be empty.
DialTptAddr() string
// DialTptAddrSourcePeerId returns the source peer ID.
// Can be empty to allow any.
DialTptAddrSourcePeerId() peer.ID
// DialTptAddrTargetPeerId returns the target peer ID.
// Cannot be empty.
DialTptAddrTargetPeerId() peer.ID
}
DialTptAddr is a directive to establish a link with a peer via a transport address.
Value: Link
func NewDialTptAddr ¶
func NewDialTptAddr(addr string, srcPeer, destPeer peer.ID) DialTptAddr
NewDialTptAddr constructs a new DialTptAddr directive.
type DialTptAddrValue ¶
DialTptAddrValue is the type emitted when resolving DialTptAddr.
type LookupTptAddr ¶
type LookupTptAddr interface {
// Directive indicates LookupTptAddr is a directive.
directive.Directive
// LookupTptAddrTargetPeerId returns the target peer ID.
// Cannot be empty.
LookupTptAddrTargetPeerId() peer.ID
}
LookupTptAddr is a directive to look up transport addresses for a peer id.
Value: string in transport address format.
func NewLookupTptAddr ¶
func NewLookupTptAddr(destPeer peer.ID) LookupTptAddr
NewLookupTptAddr constructs a new LookupTptAddr directive.
type LookupTptAddrValue ¶
type LookupTptAddrValue = string
LookupTptAddrValue is the type emitted when resolving LookupTptAddr.
func ExLookupTptAddr ¶
func ExLookupTptAddr(ctx context.Context, b bus.Bus, destPeerID peer.ID, waitOne bool) ([]LookupTptAddrValue, directive.Instance, directive.Reference, error)
ExLookupTptAddr executes collecting transport addresses for a peer.
Note: waits to return until all resolvers become idle.