2023-11-18 12:36:17 +03:00
|
|
|
package dto
|
2023-11-16 22:50:21 +03:00
|
|
|
|
|
|
|
import "net"
|
|
|
|
|
|
|
|
type EventType uint8
|
|
|
|
|
|
|
|
const (
|
|
|
|
EventStart EventType = iota
|
|
|
|
EventStop
|
2023-11-18 12:36:17 +03:00
|
|
|
EventShutdown
|
2023-11-16 22:50:21 +03:00
|
|
|
EventUnknown
|
|
|
|
)
|
|
|
|
|
|
|
|
func TypeFromAction(action string) EventType {
|
|
|
|
switch action {
|
|
|
|
case "start":
|
|
|
|
return EventStart
|
|
|
|
case "stop", "die":
|
|
|
|
return EventStop
|
|
|
|
default:
|
|
|
|
return EventUnknown
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-17 20:39:00 +03:00
|
|
|
type Event struct {
|
2023-11-16 22:50:21 +03:00
|
|
|
Type EventType
|
|
|
|
ID string
|
|
|
|
Container Container
|
|
|
|
}
|
|
|
|
|
2023-11-18 12:36:17 +03:00
|
|
|
type EventStatus struct {
|
|
|
|
ID string
|
|
|
|
Error string
|
|
|
|
Domain string
|
2023-11-17 20:39:00 +03:00
|
|
|
}
|
|
|
|
|
2023-11-16 22:50:21 +03:00
|
|
|
type Container struct {
|
|
|
|
IP net.IP
|
|
|
|
Port uint16
|
|
|
|
Server string
|
2023-11-17 20:39:00 +03:00
|
|
|
Prefix string
|
2023-11-16 22:50:21 +03:00
|
|
|
Domain string
|
|
|
|
}
|