xlink

package
v0.22.44 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptor added in v0.17.32

type Acceptor interface {
	Accept(xlink Xlink) error
}

type Dial added in v0.17.60

type Dial interface {
	GetCtrlId() string
	GetLinkId() string
	GetRouterId() string
	GetAddress() string
	GetLinkProtocol() string
	GetRouterVersion() string
}

A Dial contains the information need to dial another router

type Dialer

type Dialer interface {
	Dial(dial Dial) (Xlink, error)
}

type Factory

type Factory interface {
	CreateListener(id *identity.TokenId, f Forwarder, config transport.Configuration) (Listener, error)
	CreateDialer(id *identity.TokenId, f Forwarder, config transport.Configuration) (Dialer, error)
}

A Factory creates link listeners and link dialers

type Forwarder

type Forwarder interface {
	ForwardPayload(srcAddr xgress.Address, payload *xgress.Payload) error
	ForwardAcknowledgement(srcAddr xgress.Address, acknowledgement *xgress.Acknowledgement) error
	ForwardControl(srcAddr xgress.Address, control *xgress.Control) error
}

type LinkDestination added in v0.22.26

type LinkDestination interface {
	Id() string
	SendPayload(payload *xgress.Payload) error
	SendAcknowledgement(acknowledgement *xgress.Acknowledgement) error
	SendControl(control *xgress.Control) error
	InspectCircuit(circuitDetail *inspect.CircuitInspectDetail)
}

type Listener

type Listener interface {
	Listen() error
	GetAdvertisement() string
	GetLinkProtocol() string
	GetLinkCostTags() []string
	Close() error
}

type Registry added in v0.17.60

type Registry interface {
	// GetLink returns the link to the given router, of the given type, if one exists
	GetLink(routerId, linkType string) (Xlink, bool)
	// GetLinkById returns the link for the given id, if it exists
	GetLinkById(linkId string) (Xlink, bool)
	// GetDialLock tries to acquire a dial lock for the given dial attempt
	GetDialLock(dial Dial) (Xlink, bool)
	// DialFailed notifies the registry that a dial failed
	DialFailed(dial Dial)
	// DialSucceeded notifies the registry that a dial succeed and provides the resulting link
	DialSucceeded(link Xlink) (Xlink, bool)
	// LinkAccepted notifies the registry that a link listener accepted a dial and provides the resulting link
	LinkAccepted(link Xlink) (Xlink, bool)
	// LinkClosed notifies the registry that a link closed
	LinkClosed(link Xlink)
	// Iter provides a channel which returns all known links
	Iter() <-chan Xlink
	// Shutdown frees any resources owned by the registry
	Shutdown()

	// DebugForgetLink will remove the link from the registry to inject an error condition
	DebugForgetLink(linkId string) bool
}

Registry contains known link instances and manages link de-duplication

type Xlink interface {
	LinkDestination
	Init(metricsRegistry metrics.Registry) error
	Close() error
	CloseNotified() error
	DestinationId() string
	DestVersion() string
	LinkProtocol() string
	DialAddress() string
	HandleCloseNotification(f func())
	IsClosed() bool
	InspectLink() *inspect.LinkInspectDetail
	GetAddresses() []*ctrl_pb.LinkConn
}

Jump to

Keyboard shortcuts

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