communicate/events/event_host.go
geek 553bd57084 1. Add host event logic.
2. Add host history logic.
2016-11-29 14:34:14 +09:00

46 lines
1.1 KiB
Go

package events
import "loafle.com/overflow/collector/discovery/types"
type HostStartEvent struct {
ZoneCount int
Zone int64
}
func (i HostStartEvent) GetUrl() string {
return HOST_START
}
func NewHostStartEvent(zoneCount int, cidr int64) *HostStartEvent {
return &HostStartEvent{ZoneCount: zoneCount, Zone: cidr}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
type HostFoundEvent struct {
Zone int64
Host int64
}
func (i HostFoundEvent) GetUrl() string {
return HOST_FOUND
}
func NewHostFoundEvent(zone int64, host int64) *HostFoundEvent {
return &HostFoundEvent{Zone: zone, Host: host}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
type HostEndEvent struct {
Zone int64
HostHistory []*types.HostScanHistory
}
func (i HostEndEvent) GetUrl() string {
return HOST_END
}
func NewHostEndEvent(zone int64, hh []*types.HostScanHistory) *HostEndEvent {
return &HostEndEvent{Zone: zone, HostHistory: hh}
}