From 62249143f0ca2634eeb341c41393961efe5e424e Mon Sep 17 00:00:00 2001 From: jackdaw Date: Mon, 28 Nov 2016 14:43:22 +0900 Subject: [PATCH] . --- communicate.go | 4 ++++ communicator.go | 3 ++- events/event.go | 10 +++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/communicate.go b/communicate.go index 32b7aed..fdcc3aa 100644 --- a/communicate.go +++ b/communicate.go @@ -13,6 +13,10 @@ func init() { _c.start() } +func SetRootURL(url string) { + _c.RootURL = url +} + func Send(e *events.Event) { _c.addEvent(e) } diff --git a/communicator.go b/communicator.go index edfbc0b..b4c4832 100644 --- a/communicator.go +++ b/communicator.go @@ -8,7 +8,8 @@ import ( ) type communicator struct { - Queue chan *events.Event + Queue chan *events.Event + RootURL string } func NewCommunicator() *communicator { diff --git a/events/event.go b/events/event.go index 590364a..9a05bf3 100644 --- a/events/event.go +++ b/events/event.go @@ -6,12 +6,12 @@ const ( ) const ( - COLLECTOR_INSTALL = "http://localhost:8080/_api/collector/event/status/install" + COLLECTOR_INSTALL = "/_api/collector/event/status/install" - PORT_START = "http://localhost:8080/_api/collector/event/port/status/start" - PORT_FOUND = "http://localhost:8080/_api/collector/event/port/status/found" - PORT_END = "http://localhost:8080/_api/collector/event/port/status/end" - SERVICE_END = "http://localhost:8080/_api/collector/event/service/status/end" + PORT_START = "/_api/collector/event/port/status/start" + PORT_FOUND = "/_api/collector/event/port/status/found" + PORT_END = "/_api/collector/event/port/status/end" + SERVICE_END = "/_api/collector/event/service/status/end" ) type URLMaker interface {