mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
39 lines
614 B
Go
39 lines
614 B
Go
package idlewatcher
|
|
|
|
func (w *Watcher) running() bool {
|
|
return w.state.Load().running
|
|
}
|
|
|
|
func (w *Watcher) ready() bool {
|
|
return w.state.Load().ready
|
|
}
|
|
|
|
func (w *Watcher) error() error {
|
|
return w.state.Load().err
|
|
}
|
|
|
|
func (w *Watcher) setReady() {
|
|
w.state.Store(&containerState{
|
|
running: true,
|
|
ready: true,
|
|
})
|
|
}
|
|
|
|
func (w *Watcher) setStarting() {
|
|
w.state.Store(&containerState{
|
|
running: true,
|
|
ready: false,
|
|
})
|
|
}
|
|
|
|
func (w *Watcher) setNapping() {
|
|
w.setError(nil)
|
|
}
|
|
|
|
func (w *Watcher) setError(err error) {
|
|
w.state.Store(&containerState{
|
|
running: false,
|
|
ready: false,
|
|
err: err,
|
|
})
|
|
}
|