tptaddr

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TptAddrDelimiter = '|'

TptAddrDelimiter is the delimiter for tpt addr sections.

Variables

View Source
var ErrInvalidTptAddr = errors.New("invalid transport address: expected transport-type-id|addr")

ErrInvalidTptAddr is returned if the tptaddr was invalid.

Functions

func ParseTptAddr

func ParseTptAddr(tptAddr string) (transportID, addr string, err error)

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

type DialTptAddrValue = link.Link

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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