1. Add host event logic.
2. Add host history logic.
This commit is contained in:
parent
33881be914
commit
553bd57084
|
@ -1,5 +1,7 @@
|
||||||
package events
|
package events
|
||||||
|
|
||||||
|
import "loafle.com/overflow/collector/discovery/types"
|
||||||
|
|
||||||
type HostStartEvent struct {
|
type HostStartEvent struct {
|
||||||
ZoneCount int
|
ZoneCount int
|
||||||
Zone int64
|
Zone int64
|
||||||
|
@ -9,7 +11,7 @@ func (i HostStartEvent) GetUrl() string {
|
||||||
return HOST_START
|
return HOST_START
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHostStartEvent(zoneCount int, cidr int64) *DiscoveryStartEvent {
|
func NewHostStartEvent(zoneCount int, cidr int64) *HostStartEvent {
|
||||||
return &HostStartEvent{ZoneCount: zoneCount, Zone: cidr}
|
return &HostStartEvent{ZoneCount: zoneCount, Zone: cidr}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,20 +26,20 @@ func (i HostFoundEvent) GetUrl() string {
|
||||||
return HOST_FOUND
|
return HOST_FOUND
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHostFoundEvent(zone int64, host int64) *DiscoveryStartEvent {
|
func NewHostFoundEvent(zone int64, host int64) *HostFoundEvent {
|
||||||
return &HostFoundEvent{Zone: zone, Host: host}
|
return &HostFoundEvent{Zone: zone, Host: host}
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
type HostEndEvent struct {
|
type HostEndEvent struct {
|
||||||
Zone int64
|
Zone int64
|
||||||
Host int64
|
HostHistory []*types.HostScanHistory
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i HostEndEvent) GetUrl() string {
|
func (i HostEndEvent) GetUrl() string {
|
||||||
return HOST_END
|
return HOST_END
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHostEndEvent(zone int64, host int64) *DiscoveryStartEvent {
|
func NewHostEndEvent(zone int64, hh []*types.HostScanHistory) *HostEndEvent {
|
||||||
return &HostEndEvent{Zone: zone, Host: host}
|
return &HostEndEvent{Zone: zone, HostHistory: hh}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user