diff options
| -rw-r--r-- | common.go | 11 | ||||
| -rw-r--r-- | http.go | 12 |
2 files changed, 12 insertions, 11 deletions
@@ -2,7 +2,11 @@ package zoopb -import "go.wit.com/lib/config" +import ( + "time" + + "go.wit.com/lib/config" +) var pbfile string = "/var/cache/zookeeper/machine" @@ -13,3 +17,8 @@ func (pb *Machine) Save() error { func (pb *Machine) Load() error { return config.LoadFile(pb, pbfile) } + +func (m *Machine) SinceLastUpdate() time.Duration { + age := m.Laststamp.AsTime() + return time.Since(age) +} @@ -2,16 +2,7 @@ package zoopb -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "os/user" - - "go.wit.com/log" -) - +/* func (m *Machine) HttpPostMachine(url string) ([]byte, error) { if m == nil { // run f.InitMachine() here? @@ -73,3 +64,4 @@ func (m *Machine) HttpPostOld(url string, data []byte) ([]byte, error) { return body, nil } +*/ |
