package utils import ( "errors" "git.openprivacy.ca/openprivacy/connectivity" "git.openprivacy.ca/openprivacy/log" "net" ) // ErrorACN is a stub ACN handler used when no other valid ACN can be found. This is a critical error and as such // this is only used when the only course of action is to close Cwtch and fix the underlying discovery problem... type ErrorACN struct { } func (e ErrorACN) GetBootstrapStatus() (int, string) { return -1, "could not find tor" } func (e ErrorACN) WaitTillBootstrapped() { // instant } func (e ErrorACN) SetStatusCallback(callback func(int, string)) { callback(-1, "could not find tor please restart cwtch with an active Tor in path") } func (e ErrorACN) Restart() { // does nothing log.Errorf("Called Restart() on ErrorACN, which does nothing") } func (e ErrorACN) Open(hostname string) (net.Conn, string, error) { return nil,"", errors.New("could not find tor") } func (e ErrorACN) Listen(identity connectivity.PrivateKey, port int) (connectivity.ListenService, error) { return nil, errors.New("could not find tor") } func (e ErrorACN) GetPID() (int, error) { return 0, errors.New("could not find tor") } func (e ErrorACN) GetVersion() string { return "could not find tor" } func (e ErrorACN) Close() { // does nothing }