refactor(tunnel): simplify tor implementation (#290)

Simplify interaction within the package by avoiding to have
a tor specific config. Use a Config instead.

Part of https://github.com/ooni/probe/issues/985.
This commit is contained in:
Simone Basso 2021-04-03 21:25:08 +02:00 committed by GitHub
commit d9aff19be5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 109 additions and 92 deletions

View file

@ -41,7 +41,7 @@ func Start(ctx context.Context, config *Config) (Tunnel, error) {
return enforceNilContract(tun, err)
case "tor":
logger.Infof("starting %s tunnel; please be patient...", config.Name)
tun, err := torStart(ctx, config.Session)
tun, err := torStart(ctx, config)
return enforceNilContract(tun, err)
default:
return nil, errors.New("unsupported tunnel")