Help us shape the future of Go! Take the 2026 Go Developer Survey

tptaddr

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 9 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

	// 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
	// DialTptAddrDialerOpts are options for the dialer.
	// Address: usually {transport-type-id}|{addr}
	// Addr cannot be empty.
	DialTptAddrDialerOpts() *dialer.DialerOpts
}

DialTptAddr is a directive to establish a link with a peer via a transport address.

Value: Link

func NewDialTptAddr

func NewDialTptAddr(dialerOpts *dialer.DialerOpts, 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