xlink

package
v0.24.46 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 8 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 BackoffConfig added in v0.24.0

type BackoffConfig interface {
	GetMinRetryInterval() time.Duration
	GetMaxRetryInterval() time.Duration
	GetRetryBackoffFactor() float64
}

type Dial added in v0.17.60

type Dial interface {
	GetLinkKey() 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)
	GetGroups() []string
	GetBinding() string
	GetHealthyBackoffConfig() BackoffConfig
	GetUnhealthyBackoffConfig() BackoffConfig
	AdoptBinding(listener Listener)
}

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
	GetGroups() []string
	GetLocalBinding() string
	Close() error
}

type Registry added in v0.17.60

type Registry interface {
	// UpdateLinkDest adds or updates the state of the given destination
	UpdateLinkDest(id string, version string, healthy bool, listeners []*ctrl_pb.Listener)

	// RemoveLinkDest removes the given link destination
	RemoveLinkDest(id string)

	// DialRequested will set up a one-time dial to support older controllers which don't support sending PeerStatus
	DialRequested(ctrlCh channel.Channel, dial *ctrl_pb.Dial)

	// GetLink returns the link to the given router, of the given type, if one exists
	GetLink(linkKey string) (Xlink, bool)
	// GetLinkById returns the link for the given id, if it exists
	GetLinkById(linkId string) (Xlink, bool)
	// 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()

	// SendRouterLinkMessage will notify the given controllers about the existing link
	SendRouterLinkMessage(link Xlink, channels ...channel.Channel)

	// Inspect will return debug information about the state of links and the registry
	Inspect(timeout time.Duration) *inspect.LinksInspectResult

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

	// GetLinkKey returns the link key for the given link parameters
	GetLinkKey(dialerBinding, protocol, dest, listenerBinding string) string
}

Registry contains known link instances and manages link de-duplication

type Xlink interface {
	LinkDestination
	Key() string
	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
	IsDialed() bool
}

Jump to

Keyboard shortcuts

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