1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

34 lines
445 B
Go
Raw Normal View History

2017-06-23 16:24:31 +02:00
package main
2017-06-23 16:41:14 +02:00
import (
"time"
)
2017-06-23 16:24:31 +02:00
const (
STATE_INIT = iota
STATE_READY
STATE_UPDATING
STATE_ERROR
)
2017-06-23 16:41:14 +02:00
type StoreStatus struct {
LastRefresh time.Time
LastError error
State int
}
// Helper: stateToString
func stateToString(state int) string {
switch state {
case STATE_INIT:
return "INIT"
case STATE_READY:
return "READY"
case STATE_UPDATING:
return "UPDATING"
case STATE_ERROR:
return "ERROR"
}
return "INVALID"
}