Documentation ¶
Index ¶
- func GetKeys(inputMap interface{}) []string
- type BasePacket
- type Client
- type Cmd
- type CmdOut
- type CmdParams
- type ConnectionStats
- type Endpoint
- func (e *Endpoint) AddReplyHandler() int
- func (e *Endpoint) CloseHandler(code int, text string) error
- func (e *Endpoint) ConnectionStats() ConnectionStats
- func (e *Endpoint) DeleteReplyHandler(handlerToken int)
- func (e *Endpoint) ErrorHandler()
- func (e *Endpoint) GetCmds() interface{}
- func (e *Endpoint) GetEndpointCmds() map[string]EndpointMethod
- func (e *Endpoint) GetID() *string
- func (e *Endpoint) GetToken() int
- func (e *Endpoint) GetType() string
- func (e *Endpoint) Init()
- func (e *Endpoint) IsConnecting() bool
- func (e *Endpoint) IsReady() bool
- func (e *Endpoint) IsServer() bool
- func (e *Endpoint) OpenHandler()
- func (e *Endpoint) PingTime() int
- func (e *Endpoint) ProcessCmd(msgIn *Cmd)
- func (e *Endpoint) ProcessReply(msgIn *ReplyIn)
- func (e *Endpoint) ReceiveMessage(rawMessage []byte)
- func (e *Endpoint) RegisterMethod(methodName string, method EndpointMethod)
- func (e *Endpoint) RelayPacket(packetIn *PacketIn)
- func (e *Endpoint) SendCmd(serviceName string, methodName string, cmdParams interface{}, token *int, ...)
- func (e *Endpoint) SendCmdAwait(serviceName string, cmdName string, cmdParams interface{}, ...) *ReplyIn
- func (e *Endpoint) SendPacketBytes(drpPacketBytes []byte)
- func (e *Endpoint) SendReply(replyToken *int, returnStatus int, returnPayload interface{})
- func (e *Endpoint) ShouldRelay(msgIn *PacketIn) bool
- func (e *Endpoint) StartListening(wsConn *websocket.Conn)
- func (e *Endpoint) UpTime() int
- type EndpointAuthInfo
- type EndpointInterface
- type EndpointMethod
- type Node
- func (dn *Node) AddService(serviceObj Service)
- func (dn *Node) ApplyGenericEndpointMethods(targetEndpoint EndpointInterface)
- func (dn *Node) ApplyNodeEndpointMethods(targetEndpoint EndpointInterface)
- func (dn *Node) ConnectToMesh(onControlPlaneConnect func())
- func (dn *Node) ConnectToNode(targetNodeID string, targetURL string)
- func (dn *Node) ConnectToOtherRegistries()
- func (dn *Node) ConnectToRegistry(registryURL string, openCallback *func(), closeCallback *func())
- func (dn *Node) ConnectToRegistryByDomain()
- func (dn *Node) GetLocalServiceDefinitions(checkServiceName *string) map[string]ServiceDefinition
- func (dn *Node) GetTimestamp() string
- func (dn *Node) IsBroker() bool
- func (dn *Node) IsConnectedTo(checkNodeID string) bool
- func (dn *Node) IsRegistry() bool
- func (dn *Node) ListClientConnections() map[string]map[string]interface{}
- func (dn *Node) Log(logMessage string, isDebugMsg bool)
- func (dn *Node) PingDomainRegistries() map[string]TCPPingResults
- func (dn *Node) RawMessageToString(rawMessage *json.RawMessage) *string
- func (dn *Node) RegistryClientHandler(nodeClient *Client)
- func (dn *Node) RemoveService()
- func (dn *Node) ServiceCmd(serviceName string, method string, params interface{}, targetNodeID *string, ...) interface{}
- func (dn *Node) VerifyNodeConnection(remoteNodeID string) EndpointInterface
- type NodeDeclaration
- type NodeTable
- func (nt NodeTable) AddEntry(entryID string, entryData interface{}, lastModified string)
- func (nt NodeTable) ConvertEntryToJSON(tableEntry interface{}) []byte
- func (nt NodeTable) ConvertJSONToEntry(entryJSONBytes []byte) interface{}
- func (nt NodeTable) DeleteEntry(entryID string)
- func (nt NodeTable) GetEntry(entryID string) interface{}
- func (nt NodeTable) HasEntry(entryID string) bool
- func (nt NodeTable) UpdateEntry(entryID string, entryData interface{}, lastModified string)
- type NodeTableEntry
- type PacketIn
- type RemoteSubscription
- type ReplyIn
- type ReplyOut
- type RouteOptions
- type Service
- type ServiceDefinition
- type ServiceTable
- func (st ServiceTable) AddEntry(entryID string, entryData interface{}, lastModified string)
- func (st ServiceTable) ConvertEntryToJSON(tableEntry interface{}) []byte
- func (st ServiceTable) ConvertJSONToEntry(entryJSONBytes []byte) interface{}
- func (st ServiceTable) DeleteEntry(entryID string)
- func (st ServiceTable) GetEntry(entryID string) interface{}
- func (st ServiceTable) HasEntry(entryID string) bool
- func (st ServiceTable) UpdateEntry(entryID string, entryData interface{}, lastModified string)
- type ServiceTableEntry
- type SubscribableSource
- type SubscribableSourceInterface
- type Subscriber
- type SubscriptionManager
- type TCPPingMetrics
- type TCPPingResults
- type TopologyPacket
- type TopologyTable
- type TopologyTableEntry
- type TopologyTableEntryInterface
- type TopologyTracker
- func (tt *TopologyTracker) AdvertiseOutCheck(topologyEntry *TopologyTableEntry, targetNodeID *string) bool
- func (tt *TopologyTracker) AdvertiseOutCheckNode(nodeTableEntry *NodeTableEntry, targetNodeID *string) bool
- func (tt *TopologyTracker) AdvertiseOutCheckService(serviceTableEntry *ServiceTableEntry, targetNodeID *string) bool
- func (tt *TopologyTracker) FindInstanceOfService(serviceName *string, serviceType *string, zone *string, nodeID *string) *ServiceTableEntry
- func (tt *TopologyTracker) FindRegistriesInZone(zoneName string) []string
- func (tt *TopologyTracker) FindServicePeers(serviceID string) []string
- func (tt *TopologyTracker) GetNextHop(checkNodeID string) *string
- func (tt *TopologyTracker) GetNodeWithURL(checkNodeURL string) *string
- func (tt *TopologyTracker) GetRegistry(requestingNodeID *string) struct{ ... }
- func (tt *TopologyTracker) GetServicesWithProviders() map[string]...
- func (tt *TopologyTracker) Initialize(drpNode *Node)
- func (tt *TopologyTracker) ListConnectedRegistryNodes() []string
- func (tt *TopologyTracker) ListServices() []string
- func (tt *TopologyTracker) ProcessNodeConnect(remoteEndpoint EndpointInterface, remoteNodeDeclaration *NodeDeclaration, ...)
- func (tt *TopologyTracker) ProcessNodeDisconnect(disconnectedNodeID string)
- func (tt *TopologyTracker) ProcessPacket(topologyPacket TopologyPacket, srcNodeID string, sourceIsRegistry bool)
- func (tt *TopologyTracker) StaleEntryCleanup()
- func (tt *TopologyTracker) ValidateNodeID(checkNodeID string) bool
- type UMLAttribute
- type UMLClass
- type UMLFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasePacket ¶
type BasePacket struct { Type string `json:"type"` RouteOptions *RouteOptions `json:"routeOptions"` Token *int `json:"token"` }
BasePacket describes the base attributes common in all DRP packets
type Client ¶
type Client struct { Endpoint // contains filtered or unexported fields }
Client module is used to establish outbound connection to a Node
func (*Client) Connect ¶
func (dc *Client) Connect(wsTarget string, proxy *string, drpNode *Node, endpointID *string, retryOnClose bool, openCallback *func(), closeCallback *func())
Connect makes an outbound connection to a Node
func (*Client) IsServer ¶
IsServer tells whether or not this endpoint is the server side of the connection
func (*Client) RetryConnection ¶
func (dc *Client) RetryConnection()
RetryConnection implements retry logic
type Cmd ¶
type Cmd struct { BasePacket Method *string `json:"method"` Params *CmdParams `json:"params"` ServiceName *string `json:"serviceName"` ServiceInstanceID *string `json:"serviceInstanceID"` }
Cmd is a DRP packet sent when issuing a command
type CmdOut ¶
type CmdOut struct { BasePacket Method *string `json:"method"` Params interface{} `json:"params"` ServiceName *string `json:"serviceName"` ServiceInstanceID *string `json:"serviceInstanceID"` }
CmdOut is a DRP packet sent when issuing a command
type ConnectionStats ¶
type ConnectionStats struct {
// contains filtered or unexported fields
}
ConnectionStats provides latency and uptime stats
type Endpoint ¶
type Endpoint struct { EndpointID *string EndpointType string EndpointCmds map[string]EndpointMethod AuthInfo EndpointAuthInfo ReplyHandlerQueue map[int](chan *ReplyIn) TokenNum int Subscriptions interface{} // contains filtered or unexported fields }
Endpoint - DRP endpoint
func (*Endpoint) AddReplyHandler ¶
AddReplyHandler is used to track responses for a command
func (*Endpoint) CloseHandler ¶
CloseHandler specifies actions to be taken after a connection is closed
func (*Endpoint) ConnectionStats ¶
func (e *Endpoint) ConnectionStats() ConnectionStats
ConnectionStats returns uptime and latency info
func (*Endpoint) DeleteReplyHandler ¶
DeleteReplyHandler removes a reply handler
func (*Endpoint) ErrorHandler ¶
func (e *Endpoint) ErrorHandler()
ErrorHandler specifies actions to be taken after a connection encounters an error
func (*Endpoint) GetCmds ¶
func (e *Endpoint) GetCmds() interface{}
GetCmds returns the list of method available for the peer Endpoint to execute
func (*Endpoint) GetEndpointCmds ¶
func (e *Endpoint) GetEndpointCmds() map[string]EndpointMethod
GetEndpointCmds returns the commands available to be executed on this endpoint
func (*Endpoint) IsConnecting ¶
IsConnecting tells whether or not the Endpoint's socket connection is attempting to establish a connection TO DO - IMPLEMENT
func (*Endpoint) IsReady ¶
IsReady tells whether or not the Endpoint's socket connection is ready to communicate TO DO - IMPLEMENT
func (*Endpoint) IsServer ¶
IsServer tells whether or not this endpoint is the server side of the connection
func (*Endpoint) OpenHandler ¶
func (e *Endpoint) OpenHandler()
OpenHandler specifies actions to be taken after a connection is opened
func (*Endpoint) ProcessCmd ¶
ProcessCmd processes an inbound packet as a Cmd
func (*Endpoint) ProcessReply ¶
ProcessReply processes an inbound packet as a Reply
func (*Endpoint) ReceiveMessage ¶
ReceiveMessage determines whether a packet should be relayed or processed locally
func (*Endpoint) RegisterMethod ¶
func (e *Endpoint) RegisterMethod(methodName string, method EndpointMethod)
RegisterMethod adds a command that is allowed to be executed by the remote Endpoint
func (*Endpoint) RelayPacket ¶
RelayPacket routes a packet to another Node
func (*Endpoint) SendCmd ¶
func (e *Endpoint) SendCmd(serviceName string, methodName string, cmdParams interface{}, token *int, routeOptions *RouteOptions, serviceInstanceID *string)
SendCmd sends a command to a remote Endpoint
func (*Endpoint) SendCmdAwait ¶
func (e *Endpoint) SendCmdAwait(serviceName string, cmdName string, cmdParams interface{}, routeOptions *RouteOptions, serviceInstanceID *string) *ReplyIn
SendCmdAwait sends a command to a remote Endpoint and awaits a response
func (*Endpoint) SendPacketBytes ¶
SendPacketBytes abstracts sending functions from the communication channel functions
func (*Endpoint) SendReply ¶
SendReply returns data to a remote Endpoint which originally executed a command
func (*Endpoint) ShouldRelay ¶
ShouldRelay determines whether or not an inbound packet should be relayed
func (*Endpoint) StartListening ¶
StartListening begins listening loop on wsConn
type EndpointAuthInfo ¶
EndpointAuthInfo tracks the auth info provided by a remote Node
type EndpointInterface ¶
type EndpointInterface interface { GetID() *string GetType() string GetToken() int AddReplyHandler() int DeleteReplyHandler(int) RegisterMethod(string, EndpointMethod) SendPacketBytes([]byte) SendCmd(string, string, interface{}, *int, *RouteOptions, *string) SendCmdAwait(string, string, interface{}, *RouteOptions, *string) *ReplyIn IsServer() bool ConnectionStats() ConnectionStats GetEndpointCmds() map[string]EndpointMethod IsReady() bool IsConnecting() bool }
EndpointInterface declares the set of functions that should be implemented for any Endpoint object
type EndpointMethod ¶
type EndpointMethod func(*CmdParams, EndpointInterface, *int) interface{}
EndpointMethod defines the interface for a DRP Endpoint method
type Node ¶
type Node struct { HostID string NodeID string DomainName string Zone string Scope *string RegistryURL *string NodeRoles []string NodeDeclaration *NodeDeclaration Services map[string]Service TopicManager interface{} TopologyTracker *TopologyTracker NodeEndpoints map[string]EndpointInterface ConsumerEndpoints map[string]EndpointInterface Debug bool ConnectedToControlPlane bool HasConnectedToMesh bool PacketRelayCount uint // contains filtered or unexported fields }
Node is the base object for DRP operations; service and endpoints are bound to this
func CreateNode ¶
func CreateNode(nodeRoles []string, hostID string, domainName string, meshKey string, zone string, scope string, listeningName *string, webServerConfig interface{}, drpRoute *string, debug bool) *Node
CreateNode instantiates and returns a new node
func (*Node) AddService ¶
AddService registers a new Service object to the local Node
func (*Node) ApplyGenericEndpointMethods ¶
func (dn *Node) ApplyGenericEndpointMethods(targetEndpoint EndpointInterface)
ApplyGenericEndpointMethods applies a mandatory set of methods to an Endpoint TO DO - REGISTER METHODS AS FUNCTIONS ARE PORTED
func (*Node) ApplyNodeEndpointMethods ¶
func (dn *Node) ApplyNodeEndpointMethods(targetEndpoint EndpointInterface)
ApplyNodeEndpointMethods applies a set of methods to an Endpoint if the peer is a Node TO DO - REGISTER METHODS AS FUNCTIONS ARE PORTED
func (*Node) ConnectToMesh ¶
func (dn *Node) ConnectToMesh(onControlPlaneConnect func())
ConnectToMesh attempts to locate and connect to a Registry in the Node's domain
func (*Node) ConnectToNode ¶
ConnectToNode attempts a connection to a specific Registry Node URL
func (*Node) ConnectToOtherRegistries ¶
func (dn *Node) ConnectToOtherRegistries()
ConnectToOtherRegistries locates other Registries for a given domain
func (*Node) ConnectToRegistry ¶
ConnectToRegistry attempts a connection to a specific Registry Node URL
func (*Node) ConnectToRegistryByDomain ¶
func (dn *Node) ConnectToRegistryByDomain()
ConnectToRegistryByDomain locates a Registry for a given domain
func (*Node) GetLocalServiceDefinitions ¶
func (dn *Node) GetLocalServiceDefinitions(checkServiceName *string) map[string]ServiceDefinition
GetLocalServiceDefinitions return local service definitions
func (*Node) GetTimestamp ¶
GetTimestamp returns the timestamp in a fixed format
func (*Node) IsConnectedTo ¶
IsConnectedTo tells whether or not the local Node is directly connected to another Node
func (*Node) IsRegistry ¶
IsRegistry tells whether or not the local Node holds the Registry role
func (*Node) ListClientConnections ¶
ListClientConnections tells whether or not the local Node hold the Broker role
func (*Node) PingDomainRegistries ¶
func (dn *Node) PingDomainRegistries() map[string]TCPPingResults
PingDomainRegistries returns the SRV records for a domain
func (*Node) RawMessageToString ¶
func (dn *Node) RawMessageToString(rawMessage *json.RawMessage) *string
RawMessageToString converts a json.RawMessage ([]byte) to a string for debug output
func (*Node) RegistryClientHandler ¶
RegistryClientHandler handles connection logic when making an outbound connection to a Registry Node
func (*Node) ServiceCmd ¶
func (dn *Node) ServiceCmd(serviceName string, method string, params interface{}, targetNodeID *string, targetServiceInstanceID *string, useControlPlane bool, awaitResponse bool, callingEndpoint EndpointInterface) interface{}
ServiceCmd is used to execute a command against a local or remote Service
func (*Node) VerifyNodeConnection ¶
func (dn *Node) VerifyNodeConnection(remoteNodeID string) EndpointInterface
VerifyNodeConnection tells whether or not the local Node hold the Broker role
type NodeDeclaration ¶
type NodeDeclaration struct { NodeID string NodeRoles []string HostID string NodeURL *string DomainName string MeshKey string Zone string Scope *string }
NodeDeclaration objects are traded between Node Endpoints, currently used for mesh auth
type NodeTable ¶
type NodeTable map[string]*NodeTableEntry
NodeTable is a map of NodeTableEntry objects
func (NodeTable) ConvertEntryToJSON ¶
ConvertEntryToJSON marshals table entry to JSON
func (NodeTable) ConvertJSONToEntry ¶
ConvertJSONToEntry unmarshals JSON to table entry
func (NodeTable) DeleteEntry ¶
DeleteEntry deletes an entry from the NodeTable
func (NodeTable) UpdateEntry ¶
UpdateEntry updates an existing entry in the NodeTable
type NodeTableEntry ¶
type NodeTableEntry struct { TopologyTableEntry Roles []string NodeURL *string HostID *string }
NodeTableEntry provides the details of a Node
func (NodeTableEntry) IsBroker ¶
func (nte NodeTableEntry) IsBroker() bool
IsBroker tells whether a Node topology entry hold the Broker role
func (NodeTableEntry) IsRegistry ¶
func (nte NodeTableEntry) IsRegistry() bool
IsRegistry - tells whether a Node topology entry hold the Registry role
func (NodeTableEntry) ToJSON ¶
func (nte NodeTableEntry) ToJSON() []byte
ToJSON converts the NodeTableEntry to JSON
func (NodeTableEntry) UsesProxy ¶
func (nte NodeTableEntry) UsesProxy() bool
UsesProxy - tells whether a Node topology entry uses a Proxy
type PacketIn ¶
type PacketIn struct { BasePacket Method *string `json:"method"` Params *CmdParams `json:"params"` ServiceName *string `json:"serviceName"` ServiceInstanceID *string `json:"serviceInstanceID"` Status int `json:"status"` Payload *json.RawMessage `json:"payload"` }
PacketIn includes all possible attributes necessary to unmarshal inbound packets
type RemoteSubscription ¶
type RemoteSubscription struct { SubscribableSource StreamToken string NoSubscribersCallback interface{} }
RemoteSubscription is a subscription to a remote source
func (RemoteSubscription) RemoveSubscription ¶
func (rs RemoteSubscription) RemoveSubscription(subscription Subscriber)
RemoveSubscription removes a local subscription
type ReplyIn ¶
type ReplyIn struct { BasePacket Status int `json:"status"` Payload *json.RawMessage `json:"payload"` }
ReplyIn is used to unmarshal Reply packets we get back after sending a command
type ReplyOut ¶
type ReplyOut struct { BasePacket Status int `json:"status"` Payload interface{} `json:"payload"` }
ReplyOut is a DRP packet sent when replying to a command
func CreateReply ¶
func CreateReply(status int, payload interface{}, token *int, routeOptions *RouteOptions) *ReplyOut
CreateReply returns a Reply object
type RouteOptions ¶
type RouteOptions struct { SrcNodeID *string `json:"srcNodeID"` TgtNodeID *string `json:"tgtNodeID"` RouteHistory []string `json:"routeHistory"` }
RouteOptions is an optional Packet parameter used to take advantage of control plane routing
type Service ¶
type Service struct { ServiceName string Type string InstanceID string Sticky bool Priority uint Weight uint Zone string Scope string Dependencies []string Streams []string Status int ClientCmds map[string]EndpointMethod Classes map[string]UMLClass // contains filtered or unexported fields }
Service is used to define a DRP service
func (Service) GetDefinition ¶
func (ds Service) GetDefinition() ServiceDefinition
GetDefinition returns information about this Service for discovery
func (Service) PeerBroadcast ¶
PeerBroadcast sends a message to service peers
type ServiceDefinition ¶
type ServiceDefinition struct { InstanceID string Name string Type string Classes []string ClientCmds []string Streams []string }
ServiceDefinition is used for advertising service definitions
type ServiceTable ¶
type ServiceTable map[string]*ServiceTableEntry
ServiceTable is a map of NodeTableEntry objects
func (ServiceTable) AddEntry ¶
func (st ServiceTable) AddEntry(entryID string, entryData interface{}, lastModified string)
AddEntry adds a new entry to the ServiceTable
func (ServiceTable) ConvertEntryToJSON ¶
func (st ServiceTable) ConvertEntryToJSON(tableEntry interface{}) []byte
ConvertEntryToJSON marshals table entry to JSON
func (ServiceTable) ConvertJSONToEntry ¶
func (st ServiceTable) ConvertJSONToEntry(entryJSONBytes []byte) interface{}
ConvertJSONToEntry unmarshals JSON to table entry
func (ServiceTable) DeleteEntry ¶
func (st ServiceTable) DeleteEntry(entryID string)
DeleteEntry deletes an entry from the ServiceTable
func (ServiceTable) GetEntry ¶
func (st ServiceTable) GetEntry(entryID string) interface{}
GetEntry returns an entry from the ServiceTable
func (ServiceTable) HasEntry ¶
func (st ServiceTable) HasEntry(entryID string) bool
HasEntry tells whether or not a given entry is present in the ServiceTable
func (ServiceTable) UpdateEntry ¶
func (st ServiceTable) UpdateEntry(entryID string, entryData interface{}, lastModified string)
UpdateEntry updates an existing entry in the ServiceTable
type ServiceTableEntry ¶
type ServiceTableEntry struct { TopologyTableEntry Name *string Type *string InstanceID *string Sticky bool Priority uint Weight uint Dependencies []string Streams []string Status int }
ServiceTableEntry provides the details of a Service
func (ServiceTableEntry) ToJSON ¶
func (ste ServiceTableEntry) ToJSON() []byte
ToJSON marshals table entry to JSON
type SubscribableSource ¶
type SubscribableSource struct { NodeID string TopicName string Subscriptions []Subscriber }
SubscribableSource applies attributes to subscribable sources
type SubscribableSourceInterface ¶
type SubscribableSourceInterface interface { AddSubscription(Subscriber) RemoveSubscription(Subscriber) Send(interface{}) }
SubscribableSourceInterface should be implemented by a SubscribableSource
type Subscriber ¶
type Subscriber struct{}
Subscriber contains details sent by a process which needs data from a SubscribableSource
func (Subscriber) Send ¶
func (s Subscriber) Send(interface{})
Send forwards subscribed data to a Subscriber
type SubscriptionManager ¶
type SubscriptionManager struct{}
SubscriptionManager is used to deduplicate multiple subscriptions from local clients to a remote source
type TCPPingMetrics ¶
type TCPPingMetrics struct {
// contains filtered or unexported fields
}
TCPPingMetrics contains the metrics from a TCP ping
type TCPPingResults ¶
type TCPPingResults struct {
// contains filtered or unexported fields
}
TCPPingResults contains the TCP ping results to a given host and port
type TopologyPacket ¶
type TopologyPacket struct { OriginNodeID string `json:"originNodeID"` Cmd string `json:"cmd"` Type string `json:"type"` ID string `json:"id"` Scope string `json:"scope"` Zone string `json:"zone"` Data json.RawMessage `json:"data"` }
TopologyPacket defines the structure of a packet transmitted between Nodes
type TopologyTable ¶
type TopologyTable interface { HasEntry(string) bool AddEntry(string, interface{}, string) UpdateEntry(string, interface{}, string) GetEntry(string) interface{} DeleteEntry(string) ConvertJSONToEntry([]byte) interface{} ConvertEntryToJSON(interface{}) []byte }
TopologyTable is used for NodeTable and ServiceTable modules
type TopologyTableEntry ¶
type TopologyTableEntry struct { TopologyTableEntryInterface NodeID *string ProxyNodeID *string Scope *string Zone *string LearnedFrom *string LastModified *string }
TopologyTableEntry is used for NodeTableEntry and ServiceTableEntry
func (TopologyTableEntry) GetLearnedFrom ¶
func (tte TopologyTableEntry) GetLearnedFrom() *string
GetLearnedFrom returns the LearnedFrom attribute
func (TopologyTableEntry) SetLearnedFrom ¶
func (tte TopologyTableEntry) SetLearnedFrom(learnedFrom string, lastModified string)
SetLearnedFrom sets the LearnedFrom attribute
type TopologyTableEntryInterface ¶
type TopologyTableEntryInterface interface { GetLearnedFrom() *string SetLearnedFrom(string, string) ToJSON() []byte }
TopologyTableEntryInterface is used for NodeTableEntry and ServiceTableEntry
type TopologyTracker ¶
type TopologyTracker struct { NodeTable *NodeTable ServiceTable *ServiceTable // contains filtered or unexported fields }
TopologyTracker keeps track of Nodes and Services in the mesh
func (*TopologyTracker) AdvertiseOutCheck ¶
func (tt *TopologyTracker) AdvertiseOutCheck(topologyEntry *TopologyTableEntry, targetNodeID *string) bool
AdvertiseOutCheck determines whether or not a TopologyTableEntry should be forwarded to given NodeID
func (*TopologyTracker) AdvertiseOutCheckNode ¶
func (tt *TopologyTracker) AdvertiseOutCheckNode(nodeTableEntry *NodeTableEntry, targetNodeID *string) bool
AdvertiseOutCheckNode determines whether or not a Node topology entry should be advertised to another Node
func (*TopologyTracker) AdvertiseOutCheckService ¶
func (tt *TopologyTracker) AdvertiseOutCheckService(serviceTableEntry *ServiceTableEntry, targetNodeID *string) bool
AdvertiseOutCheckService determines whether or not a Service topology entry should be advertised to another Node
func (*TopologyTracker) FindInstanceOfService ¶
func (tt *TopologyTracker) FindInstanceOfService(serviceName *string, serviceType *string, zone *string, nodeID *string) *ServiceTableEntry
FindInstanceOfService finds the best instance of a service to execute a command
func (*TopologyTracker) FindRegistriesInZone ¶
func (tt *TopologyTracker) FindRegistriesInZone(zoneName string) []string
FindRegistriesInZone returns a list of Registry Nodes in a given zone
func (*TopologyTracker) FindServicePeers ¶
func (tt *TopologyTracker) FindServicePeers(serviceID string) []string
FindServicePeers returns the service peers for a specified instance
func (*TopologyTracker) GetNextHop ¶
func (tt *TopologyTracker) GetNextHop(checkNodeID string) *string
GetNextHop return the next hop to communicate with a given Node ID
func (*TopologyTracker) GetNodeWithURL ¶
func (tt *TopologyTracker) GetNodeWithURL(checkNodeURL string) *string
GetNodeWithURL returns NodeID with a given NodeURL
func (*TopologyTracker) GetRegistry ¶
func (tt *TopologyTracker) GetRegistry(requestingNodeID *string) struct { NodeTable map[string]*NodeTableEntry ServiceTable map[string]*ServiceTableEntry }
GetRegistry returns a copy of the local Registry (Node and Service tables)
func (*TopologyTracker) GetServicesWithProviders ¶
func (tt *TopologyTracker) GetServicesWithProviders() map[string]*struct { ServiceName string Providers []string }
GetServicesWithProviders returns a map of services along with the Providers' NodeIDs (used by PathCmd)
func (*TopologyTracker) Initialize ¶
func (tt *TopologyTracker) Initialize(drpNode *Node)
Initialize creates the node and service tables
func (*TopologyTracker) ListConnectedRegistryNodes ¶
func (tt *TopologyTracker) ListConnectedRegistryNodes() []string
ListConnectedRegistryNodes returns a list of connected Registry NodeIDs
func (*TopologyTracker) ListServices ¶
func (tt *TopologyTracker) ListServices() []string
ListServices returns a unique list of service names available for use
func (*TopologyTracker) ProcessNodeConnect ¶
func (tt *TopologyTracker) ProcessNodeConnect(remoteEndpoint EndpointInterface, remoteNodeDeclaration *NodeDeclaration, localNodeIsProxy bool)
ProcessNodeConnect executes after connecting to a Node endpoint
func (*TopologyTracker) ProcessNodeDisconnect ¶
func (tt *TopologyTracker) ProcessNodeDisconnect(disconnectedNodeID string)
ProcessNodeDisconnect processes topology commands for Node disconnect events
func (*TopologyTracker) ProcessPacket ¶
func (tt *TopologyTracker) ProcessPacket(topologyPacket TopologyPacket, srcNodeID string, sourceIsRegistry bool)
ProcessPacket handles DRP topology packets
func (*TopologyTracker) StaleEntryCleanup ¶
func (tt *TopologyTracker) StaleEntryCleanup()
StaleEntryCleanup removed stale Node and Service entries
func (*TopologyTracker) ValidateNodeID ¶
func (tt *TopologyTracker) ValidateNodeID(checkNodeID string) bool
ValidateNodeID tells whether or not a NodeID is present in the NodeTable
type UMLAttribute ¶
type UMLAttribute struct { Name string Stereotype string Visibility string Derived bool Type string Default string Multiplicity string Restrictions []string }
UMLAttribute is assigned to UMLClass
type UMLClass ¶
type UMLClass struct { Name string Stereotypes string PrimaryKey string Attributes map[string]UMLAttribute Functions map[string]UMLFunction }
UMLClass declares data structures offered by a service