Skip to content
Snippets Groups Projects

Add basic application framework and example application to show interaction between events an NBI

Merged Ghost User requested to merge istaester/init-application-framework into develop
2 files
+ 149
85
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -36,7 +36,7 @@ func NewTopologyServer(
}
// AddLink adds a new link to the topology
func (t Topology) AddLink(ctx context.Context, request *apb.AddLinkRequest) (*apb.AddLinkResponse, error) {
func (t *Topology) AddLink(ctx context.Context, request *apb.AddLinkRequest) (*apb.AddLinkResponse, error) {
sourceNode, sourcePort, err := t.ensureNodeAndPortExists(request.Link.SourceNode, request.Link.SourcePort)
if err != nil {
return nil, status.Errorf(codes.Aborted, "%v", err)
@@ -67,7 +67,7 @@ func (t Topology) AddLink(ctx context.Context, request *apb.AddLinkRequest) (*ap
}
// GetTopology returns the current topology in the form of all links
func (t Topology) GetTopology(ctx context.Context, request *apb.GetTopologyRequest) (*apb.GetTopologyResponse, error) {
func (t *Topology) GetTopology(ctx context.Context, request *apb.GetTopologyRequest) (*apb.GetTopologyResponse, error) {
topo, err := t.topologyService.GetAll()
if err != nil {
return nil, status.Errorf(codes.Aborted, "%v", err)
@@ -103,7 +103,7 @@ func (t Topology) GetTopology(ctx context.Context, request *apb.GetTopologyReque
}, nil
}
func (t Topology) ensureNodeAndPortExists(incomingNode *apb.Node, incomingPort *apb.Port) (nodes.Node, ports.Port, error) {
func (t *Topology) ensureNodeAndPortExists(incomingNode *apb.Node, incomingPort *apb.Port) (nodes.Node, ports.Port, error) {
node, err := t.nodeService.EnsureExists(
nodes.Node{
ID: getExistingOrCreateNewUUIDFromString(incomingNode.Id),
Loading