2016-05-03 16:31:56 +02:00
|
|
|
package config
|
|
|
|
|
2016-06-07 08:29:29 +02:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2016-05-03 16:31:56 +02:00
|
|
|
type OnionscanConfig struct {
|
|
|
|
TorProxyAddress string
|
|
|
|
DirectoryDepth int
|
2016-06-05 20:54:01 +02:00
|
|
|
Fingerprint bool
|
2016-06-07 08:29:29 +02:00
|
|
|
Timeout time.Duration
|
2016-05-03 16:31:56 +02:00
|
|
|
}
|
|
|
|
|
2016-06-07 08:29:29 +02:00
|
|
|
func Configure(torProxyAddress string, directoryDepth int, fingerprint bool, timeout int) *OnionscanConfig {
|
2016-05-03 16:31:56 +02:00
|
|
|
onionScan := new(OnionscanConfig)
|
|
|
|
onionScan.TorProxyAddress = torProxyAddress
|
|
|
|
onionScan.DirectoryDepth = directoryDepth
|
2016-06-05 20:54:01 +02:00
|
|
|
onionScan.Fingerprint = fingerprint
|
2016-06-07 08:29:29 +02:00
|
|
|
onionScan.Timeout = time.Duration(time.Second * time.Duration(timeout))
|
2016-05-03 16:31:56 +02:00
|
|
|
return onionScan
|
|
|
|
}
|