From 553bd57084de49400c4a394e9594407595aee7ff Mon Sep 17 00:00:00 2001 From: geek Date: Tue, 29 Nov 2016 14:34:14 +0900 Subject: [PATCH] 1. Add host event logic. 2. Add host history logic. --- events/event_host.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/events/event_host.go b/events/event_host.go index c72807e..aa189a5 100644 --- a/events/event_host.go +++ b/events/event_host.go @@ -1,5 +1,7 @@ package events +import "loafle.com/overflow/collector/discovery/types" + type HostStartEvent struct { ZoneCount int Zone int64 @@ -9,7 +11,7 @@ func (i HostStartEvent) GetUrl() string { return HOST_START } -func NewHostStartEvent(zoneCount int, cidr int64) *DiscoveryStartEvent { +func NewHostStartEvent(zoneCount int, cidr int64) *HostStartEvent { return &HostStartEvent{ZoneCount: zoneCount, Zone: cidr} } @@ -24,20 +26,20 @@ func (i HostFoundEvent) GetUrl() string { return HOST_FOUND } -func NewHostFoundEvent(zone int64, host int64) *DiscoveryStartEvent { +func NewHostFoundEvent(zone int64, host int64) *HostFoundEvent { return &HostFoundEvent{Zone: zone, Host: host} } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// type HostEndEvent struct { - Zone int64 - Host int64 + Zone int64 + HostHistory []*types.HostScanHistory } func (i HostEndEvent) GetUrl() string { return HOST_END } -func NewHostEndEvent(zone int64, host int64) *DiscoveryStartEvent { - return &HostEndEvent{Zone: zone, Host: host} +func NewHostEndEvent(zone int64, hh []*types.HostScanHistory) *HostEndEvent { + return &HostEndEvent{Zone: zone, HostHistory: hh} }