29 lines
337 B
Go
29 lines
337 B
Go
package state
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
)
|
|
|
|
type StateStruct struct {
|
|
Machines map[string]Machine
|
|
Mutex sync.RWMutex
|
|
}
|
|
|
|
type Machine struct {
|
|
State int
|
|
JobStart time.Time
|
|
JobEnd time.Time
|
|
Message string
|
|
}
|
|
|
|
const (
|
|
Working = iota
|
|
Completed
|
|
Error
|
|
)
|
|
|
|
var State StateStruct = StateStruct{
|
|
Machines: map[string]Machine{},
|
|
}
|