From 9777554d1c514c641136e4d2f4a72b85aa748206 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Wed, 12 Jul 2017 19:05:05 +0100 Subject: [PATCH] standardizing id for monit as api gateway now returns the full service id when performing service operations --- component.go | 9 +-------- service.go | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/component.go b/component.go index 5e169d3..4d8ae75 100644 --- a/component.go +++ b/component.go @@ -7,7 +7,6 @@ package main import ( "encoding/json" "log" - "strings" "github.com/nats-io/nats" "github.com/r3labs/sse" @@ -50,11 +49,5 @@ func processComponent(msg *nats.Msg) { } func (c *Component) getID() string { - if len(c.Service) == 36 { - return c.Service - } - - pieces := strings.Split(c.Service, "-") - - return pieces[len(pieces)-1] + return c.Service } diff --git a/service.go b/service.go index e80b70e..c116f0a 100644 --- a/service.go +++ b/service.go @@ -7,7 +7,6 @@ package main import ( "encoding/json" "log" - "strings" "time" "github.com/nats-io/nats" @@ -57,12 +56,5 @@ func processService(msg *nats.Msg) { } func (s *Service) getID() string { - if len(s.ID) == 36 { - return s.ID - } - - var pieces []string - pieces = strings.Split(s.ID, "-") - - return pieces[len(pieces)-1] + return s.ID }