1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
2021-10-20 18:36:30 +00:00

38 lines
610 B
Go

// Package store provides a store for persisting and
// querying neighbors and routes.
package store
import (
"time"
)
// Store State Constants
const (
STATE_INIT = iota
STATE_READY
STATE_UPDATING
STATE_ERROR
)
// StoreStatus defines a status the store can be in
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"
}