You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
575 B
Go
36 lines
575 B
Go
package beehive
|
|
|
|
import "time"
|
|
|
|
type Task struct {
|
|
ID int
|
|
Type TaskType
|
|
Created time.Time
|
|
Started time.Time
|
|
Completed time.Time
|
|
DeploymentID int
|
|
}
|
|
|
|
type TaskType int
|
|
|
|
// Note: Task types must only be appended to preserve values.
|
|
const (
|
|
TaskHealth TaskType = iota + 1
|
|
TaskDeploy
|
|
TaskStart
|
|
TaskRestart
|
|
TaskStop
|
|
)
|
|
|
|
type TaskMessage struct {
|
|
Type TaskType
|
|
Parameters map[string]string
|
|
}
|
|
|
|
func NewTask(t TaskType, parameters map[string]string) *TaskMessage {
|
|
return &TaskMessage{
|
|
Type: t,
|
|
Parameters: parameters,
|
|
}
|
|
}
|