discovery
This commit is contained in:
snoop 2016-11-28 14:48:38 +09:00
parent c1e4ecfd5d
commit 2c9c23c453
2 changed files with 17 additions and 5 deletions

View File

@ -8,6 +8,9 @@ const (
const ( const (
COLLECTOR_INSTALL = "/_api/collector/discovery/event/status/install" COLLECTOR_INSTALL = "/_api/collector/discovery/event/status/install"
DISCOVERY_START = "/_api/collector/event/discovery/status/start"
DISCOVERY_END = "/_api/collector/event/discovery/status/end"
HOST_START = "/_api/collector/discovery/event/host/status/start" HOST_START = "/_api/collector/discovery/event/host/status/start"
HOST_FOUND = "/_api/collector/discovery/event/host/status/found" HOST_FOUND = "/_api/collector/discovery/event/host/status/found"
HOST_END = "/_api/collector/discovery/event/host/status/end" HOST_END = "/_api/collector/discovery/event/host/status/end"

View File

@ -1,9 +1,6 @@
package events package events
const ( const ()
DEAFULT = "http://localhost:8080"
DISCOVERY_START = "/_api/collector/event/discovery/status/start"
)
type DiscoveryStartEvent struct { type DiscoveryStartEvent struct {
Message string Message string
@ -11,9 +8,21 @@ type DiscoveryStartEvent struct {
} }
func (i DiscoveryStartEvent) GetUrl() string { func (i DiscoveryStartEvent) GetUrl() string {
return DEAFULT + DISCOVERY_START return DISCOVERY_START
} }
func NewDiscoveryStartEvent(message string, cidr int64) *DiscoveryStartEvent { func NewDiscoveryStartEvent(message string, cidr int64) *DiscoveryStartEvent {
return &DiscoveryStartEvent{Message: message, Zone: cidr} return &DiscoveryStartEvent{Message: message, Zone: cidr}
} }
type DiscoveryEndEvent struct {
Message string
}
func (i DiscoveryEndEvent) GetUrl() string {
return DISCOVERY_START
}
func NewDiscoveryEndEvent(message string) *DiscoveryEndEvent {
return &DiscoveryEndEvent{Message: message}
}