sshpoke/pkg/dto/models.go

44 lines
564 B
Go

package dto
import "net"
type EventType uint8
const (
EventStart EventType = iota
EventStop
EventShutdown
EventUnknown
)
func TypeFromAction(action string) EventType {
switch action {
case "start":
return EventStart
case "stop", "die":
return EventStop
default:
return EventUnknown
}
}
type Event struct {
Type EventType
ID string
Container Container
}
type EventStatus struct {
ID string
Error string
Domain string
}
type Container struct {
IP net.IP
Port uint16
Server string
Prefix string
Domain string
}