blob: 1c63b4c7db0ce0da8903e26c565dd993d320bf3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// Copyright 1994-2025 WIT.COM Inc Licensed GPL 3.0
package zoopb
import (
"time"
"go.wit.com/lib/config"
)
var pbfile string = "/var/cache/zookeeper/machine"
func (pb *Machine) Save() error {
return config.SavePB(pb, pbfile)
}
func (pb *Machine) Load() error {
return config.LoadFile(pb, pbfile)
}
func (m *Machine) SinceLastUpdate() time.Duration {
age := m.Laststamp.AsTime()
return time.Since(age)
}
|