communicate/events/event_port.go

58 lines
919 B
Go
Raw Normal View History

2016-11-28 05:15:31 +00:00
package events
2016-11-28 05:25:11 +00:00
2016-11-28 05:32:04 +00:00
// Port Event Start
2016-11-28 05:25:11 +00:00
type PortStartEvent struct {
Zone int64
2016-11-28 05:32:04 +00:00
PortCount uint16
2016-11-28 05:25:11 +00:00
}
func (i PortStartEvent) GetUrl() string {
2016-11-28 05:32:04 +00:00
return PORT_START
2016-11-28 05:25:11 +00:00
}
2016-11-28 05:32:04 +00:00
func NewPortStartEvent(zone int64, portCount uint16) *PortStartEvent {
2016-11-28 05:25:11 +00:00
return &PortStartEvent{
Zone: zone,
PortCount: portCount,
}
}
2016-11-28 05:32:04 +00:00
// Port Event Found
type PortFoundEvent struct {
Zone int64
Host int64
Port uint16
Type string
}
func (i PortFoundEvent) GetUrl() string {
return PORT_FOUND
}
func NewPortFoundEvent(zone int64, host int64, port uint16, t string) *PortFoundEvent {
return &PortFoundEvent{
Zone: zone,
Host: host,
Port: port,
Type: t,
}
}
// Port Event Found
type PortEndEvent struct {
Zone int64
Host int64
// history ???
}
func (i PortEndEvent) GetUrl() string {
return PORT_START
}
func NewPortEndEvent(zone int64, host int64) *PortEndEvent {
return &PortEndEvent{
Zone: zone,
Host: host,
}
}