fix: import path should be github.com/ooni/probe-cli/v3 (#200)
See https://github.com/ooni/probe/issues/1335#issuecomment-771499511
This commit is contained in:
parent
faa9308b1e
commit
b1ce300c8d
68 changed files with 86 additions and 85 deletions
|
|
@ -1,49 +0,0 @@
|
|||
// Package autorun contains code to manage automatic runs
|
||||
package autorun
|
||||
|
||||
import "sync"
|
||||
|
||||
const (
|
||||
// StatusScheduled indicates that OONI is scheduled to run
|
||||
// periodically in the background.
|
||||
StatusScheduled = "scheduled"
|
||||
|
||||
// StatusStopped indicates that OONI is not scheduled to
|
||||
// run periodically in the background.
|
||||
StatusStopped = "stopped"
|
||||
|
||||
// StatusRunning indicates that OONI is currently
|
||||
// running in the background.
|
||||
StatusRunning = "running"
|
||||
)
|
||||
|
||||
// Manager manages automatic runs
|
||||
type Manager interface {
|
||||
LogShow() error
|
||||
LogStream() error
|
||||
Start() error
|
||||
Status() (string, error)
|
||||
Stop() error
|
||||
}
|
||||
|
||||
var (
|
||||
registry map[string]Manager
|
||||
mtx sync.Mutex
|
||||
)
|
||||
|
||||
func register(platform string, manager Manager) {
|
||||
defer mtx.Unlock()
|
||||
mtx.Lock()
|
||||
if registry == nil {
|
||||
registry = make(map[string]Manager)
|
||||
}
|
||||
registry[platform] = manager
|
||||
}
|
||||
|
||||
// Get gets the specified autorun manager. This function
|
||||
// returns nil if no autorun manager exists.
|
||||
func Get(platform string) Manager {
|
||||
defer mtx.Unlock()
|
||||
mtx.Lock()
|
||||
return registry[platform]
|
||||
}
|
||||
Loading…
Reference in a new issue