drpmesh

package
v0.0.0-...-7169df1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeys

func GetKeys(inputMap interface{}) []string

GetKeys returns the list of keys from a map as a slice

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

func (dc *Client) IsServer() bool

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

func CreateCmd

func CreateCmd(method *string, params *CmdParams, serviceName *string, token *int, serviceInstanceID *string, routeOptions *RouteOptions) *Cmd

CreateCmd returns a Cmd object

func (*Cmd) ToJSON

func (dc *Cmd) ToJSON() []byte

ToJSON converts the packet to a JSON byte array

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

func (*CmdOut) ToJSON

func (dc *CmdOut) ToJSON() []byte

ToJSON converts the packet to a JSON byte array

type CmdParams

type CmdParams map[string]*json.RawMessage

CmdParams - DRP Cmd parameters

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

func (e *Endpoint) AddReplyHandler() int

AddReplyHandler is used to track responses for a command

func (*Endpoint) CloseHandler

func (e *Endpoint) CloseHandler(code int, text string) error

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

func (e *Endpoint) DeleteReplyHandler(handlerToken int)

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) GetID

func (e *Endpoint) GetID() *string

GetID returns the ID of the Endpoint

func (*Endpoint) GetToken

func (e *Endpoint) GetToken() int

GetToken returns the next token to be used for the Endpoint

func (*Endpoint) GetType

func (e *Endpoint) GetType() string

GetType returns the type of the Endpoint

func (*Endpoint) Init

func (e *Endpoint) Init()

Init initializes Endpoint attributes

func (*Endpoint) IsConnecting

func (e *Endpoint) IsConnecting() bool

IsConnecting tells whether or not the Endpoint's socket connection is attempting to establish a connection TO DO - IMPLEMENT

func (*Endpoint) IsReady

func (e *Endpoint) IsReady() bool

IsReady tells whether or not the Endpoint's socket connection is ready to communicate TO DO - IMPLEMENT

func (*Endpoint) IsServer

func (e *Endpoint) IsServer() bool

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) PingTime

func (e *Endpoint) PingTime() int

PingTime TO DO - IMPLEMENT

func (*Endpoint) ProcessCmd

func (e *Endpoint) ProcessCmd(msgIn *Cmd)

ProcessCmd processes an inbound packet as a Cmd

func (*Endpoint) ProcessReply

func (e *Endpoint) ProcessReply(msgIn *ReplyIn)

ProcessReply processes an inbound packet as a Reply

func (*Endpoint) ReceiveMessage

func (e *Endpoint) ReceiveMessage(rawMessage []byte)

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

func (e *Endpoint) RelayPacket(packetIn *PacketIn)

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

func (e *Endpoint) SendPacketBytes(drpPacketBytes []byte)

SendPacketBytes abstracts sending functions from the communication channel functions

func (*Endpoint) SendReply

func (e *Endpoint) SendReply(replyToken *int, returnStatus int, returnPayload interface{})

SendReply returns data to a remote Endpoint which originally executed a command

func (*Endpoint) ShouldRelay

func (e *Endpoint) ShouldRelay(msgIn *PacketIn) bool

ShouldRelay determines whether or not an inbound packet should be relayed

func (*Endpoint) StartListening

func (e *Endpoint) StartListening(wsConn *websocket.Conn)

StartListening begins listening loop on wsConn

func (*Endpoint) UpTime

func (e *Endpoint) UpTime() int

UpTime TO DO - IMPLEMENT

type EndpointAuthInfo

type EndpointAuthInfo struct {
	Type     string
	Value    string
	UserInfo interface{}
}

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

func (dn *Node) AddService(serviceObj Service)

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

func (dn *Node) ConnectToNode(targetNodeID string, targetURL string)

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

func (dn *Node) ConnectToRegistry(registryURL string, openCallback *func(), closeCallback *func())

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

func (dn *Node) GetTimestamp() string

GetTimestamp returns the timestamp in a fixed format

func (*Node) IsBroker

func (dn *Node) IsBroker() bool

IsBroker tells whether or not the local Node hold the Broker role

func (*Node) IsConnectedTo

func (dn *Node) IsConnectedTo(checkNodeID string) bool

IsConnectedTo tells whether or not the local Node is directly connected to another Node

func (*Node) IsRegistry

func (dn *Node) IsRegistry() bool

IsRegistry tells whether or not the local Node holds the Registry role

func (*Node) ListClientConnections

func (dn *Node) ListClientConnections() map[string]map[string]interface{}

ListClientConnections tells whether or not the local Node hold the Broker role

func (*Node) Log

func (dn *Node) Log(logMessage string, isDebugMsg bool)

Log data to console using standard format

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

func (dn *Node) RegistryClientHandler(nodeClient *Client)

RegistryClientHandler handles connection logic when making an outbound connection to a Registry Node

func (*Node) RemoveService

func (dn *Node) RemoveService()

RemoveService TO DO - IMPLEMENT

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) AddEntry

func (nt NodeTable) AddEntry(entryID string, entryData interface{}, lastModified string)

AddEntry adds a new entry to the NodeTable

func (NodeTable) ConvertEntryToJSON

func (nt NodeTable) ConvertEntryToJSON(tableEntry interface{}) []byte

ConvertEntryToJSON marshals table entry to JSON

func (NodeTable) ConvertJSONToEntry

func (nt NodeTable) ConvertJSONToEntry(entryJSONBytes []byte) interface{}

ConvertJSONToEntry unmarshals JSON to table entry

func (NodeTable) DeleteEntry

func (nt NodeTable) DeleteEntry(entryID string)

DeleteEntry deletes an entry from the NodeTable

func (NodeTable) GetEntry

func (nt NodeTable) GetEntry(entryID string) interface{}

GetEntry returns an entry from the NodeTable

func (NodeTable) HasEntry

func (nt NodeTable) HasEntry(entryID string) bool

HasEntry tells whether or not a given entry is present in the NodeTable

func (NodeTable) UpdateEntry

func (nt NodeTable) UpdateEntry(entryID string, entryData interface{}, lastModified string)

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

func (*ReplyIn) ToJSON

func (dri *ReplyIn) ToJSON() []byte

ToJSON converts the packet to a JSON byte array

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

func (*ReplyOut) ToJSON

func (dr *ReplyOut) ToJSON() []byte

ToJSON converts the packet to a JSON byte array

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) AddClass

func (ds Service) AddClass(newClass UMLClass)

AddClass add a new UMLClass to a Service

func (Service) GetDefinition

func (ds Service) GetDefinition() ServiceDefinition

GetDefinition returns information about this Service for discovery

func (Service) PeerBroadcast

func (ds Service) PeerBroadcast(method string, params interface{})

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

func (Subscriber) Terminate

func (s Subscriber) Terminate()

Terminate removes open subscriptions

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

func (UMLClass) GetPK

func (uc UMLClass) GetPK() *string

GetPK returns the primary key field of a class

type UMLFunction

type UMLFunction struct {
	Name       string
	Visibility string
	Parameters []string
	Return     string
}

UMLFunction is assigned to UMLClass

Jump to

Keyboard shortcuts

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