Storages are not used outside of services. The annad object used to write state information to the storage. This functionality should be added to storage implementations so that this is provided out of the box. Therefore Boot should be added to the Storage interface.
// writeStateInfo writes state information to the configured general storage.
// The information look like this.
//
// "time": "16/03/27 21:14:35"
// "version": "84ehdv0"
//
func (a *annad) writeStateInfo() {
a.Log.WithTags(spec.Tags{C: nil, L: "D", O: a, V: 13}, "call writeStateInfo")
err := a.Storage().General().Set("version", version)
panicOnError(err)
for {
dateTime := time.Now().Format("06/01/02 15:04:05")
err := a.Storage().General().Set("time", dateTime)
if err != nil {
a.Log.WithTags(spec.Tags{C: nil, L: "E", O: a, V: 4}, "%#v", maskAny(err))
}
time.Sleep(5 * time.Second)
}
}
Storages are not used outside of services. The
annad
object used to write state information to the storage. This functionality should be added to storage implementations so that this is provided out of the box. ThereforeBoot
should be added to theStorage
interface.