This commit is contained in:
jackdaw 2016-11-28 14:43:22 +09:00
parent 8a96b8bbf0
commit 62249143f0
3 changed files with 11 additions and 6 deletions

View File

@ -13,6 +13,10 @@ func init() {
_c.start() _c.start()
} }
func SetRootURL(url string) {
_c.RootURL = url
}
func Send(e *events.Event) { func Send(e *events.Event) {
_c.addEvent(e) _c.addEvent(e)
} }

View File

@ -8,7 +8,8 @@ import (
) )
type communicator struct { type communicator struct {
Queue chan *events.Event Queue chan *events.Event
RootURL string
} }
func NewCommunicator() *communicator { func NewCommunicator() *communicator {

View File

@ -6,12 +6,12 @@ const (
) )
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_START = "/_api/collector/event/port/status/start"
PORT_FOUND = "http://localhost:8080/_api/collector/event/port/status/found" PORT_FOUND = "/_api/collector/event/port/status/found"
PORT_END = "http://localhost:8080/_api/collector/event/port/status/end" PORT_END = "/_api/collector/event/port/status/end"
SERVICE_END = "http://localhost:8080/_api/collector/event/service/status/end" SERVICE_END = "/_api/collector/event/service/status/end"
) )
type URLMaker interface { type URLMaker interface {