Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackoffConfig ¶
type Dial ¶
type Dial interface { GetLinkKey() string GetLinkId() string GetRouterId() string GetAddress() string GetLinkProtocol() string GetRouterVersion() string GetIteration() uint32 }
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 LinkDestination ¶
type Registry ¶
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 ¶
type Xlink interface { LinkDestination Key() string Init(metricsRegistry metrics.Registry) error Close() error CloseNotified() error DestinationId() string DestVersion() string LinkProtocol() string DialAddress() string CloseOnce(f func()) IsClosed() bool InspectLink() *inspect.LinkInspectDetail GetAddresses() []*ctrl_pb.LinkConn IsDialed() bool Iteration() uint32 AreFaultsSent() bool DuplicatesRejected() uint32 }
Click to show internal directories.
Click to hide internal directories.