diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-24 19:59:36 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-24 19:59:36 +0100 |
commit | 388caec0b6ed6b9cccb15de7ee2f093361772764 (patch) | |
tree | e4ea3c3c9c2e9c0602e5b963d4a2fde00944f987 /internal | |
parent | 505a4d9b91fe2597ef1fee845f8451055d2cda02 (diff) |
Few clean-ups
Diffstat (limited to 'internal')
-rw-r--r-- | internal/options/options.go | 2 | ||||
-rw-r--r-- | internal/qna/qna.go | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/internal/options/options.go b/internal/options/options.go index f7510ba..8e10686 100644 --- a/internal/options/options.go +++ b/internal/options/options.go @@ -10,6 +10,7 @@ type Options struct { NumWorkers int MetricsInterval time.Duration Timeout time.Duration + MaxResponse int64 } func Parse() (opts Options) { @@ -17,6 +18,7 @@ func Parse() (opts Options) { flag.IntVar(&opts.NumWorkers, "w", 10, "number of parallel workers") flag.DurationVar(&opts.Timeout, "t", 10*time.Second, "timeout for each website visit") flag.DurationVar(&opts.MetricsInterval, "m", 5*time.Second, "how often to emit metrics") + flag.Int64Var(&opts.MaxResponse, "r", 128*1024*1024, "max response body size to accept") flag.Parse() return } diff --git a/internal/qna/qna.go b/internal/qna/qna.go new file mode 100644 index 0000000..5336811 --- /dev/null +++ b/internal/qna/qna.go @@ -0,0 +1,14 @@ +package qna + +type Question struct { + Domain string // domain name to visit via HTTPS +} + +type Answer struct { + Domain string // domain name of the visited HTTPS site + OK bool // true if HTTP GET request succeeded + + HTTP bool // true if onion location was found via HTTP header + HTML bool // true if onion location was found via HTML attribute + Onion string // the site's onion location URL (if any) +} |