Spring cleanup: remove unused/unneded code (#761)
* cleanup: remove the archival package See https://github.com/ooni/probe/issues/2116 * cleanup: remove websteps fall 2021 edition See https://github.com/ooni/probe/issues/2116 * cleanup: remove JavaScript based testing framework https://github.com/ooni/probe/issues/2116 * cleanup: remove the unused ooapi package See https://github.com/ooni/probe/issues/2116
This commit is contained in:
@@ -11,9 +11,7 @@ import (
|
||||
|
||||
"github.com/apex/log"
|
||||
"github.com/ooni/probe-cli/v3/internal/cmd/oohelper/internal"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/experiment/webstepsx"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/netx"
|
||||
"github.com/ooni/probe-cli/v3/internal/measurex"
|
||||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
"github.com/ooni/probe-cli/v3/internal/runtimex"
|
||||
)
|
||||
@@ -25,7 +23,6 @@ var (
|
||||
resolver model.Resolver
|
||||
server = flag.String("server", "", "URL of the test helper")
|
||||
target = flag.String("target", "", "Target URL for the test helper")
|
||||
fwebsteps = flag.Bool("websteps", false, "Use the websteps TH")
|
||||
)
|
||||
|
||||
func newhttpclient() *http.Client {
|
||||
@@ -54,34 +51,12 @@ func main() {
|
||||
}
|
||||
flag.Parse()
|
||||
log.SetLevel(logmap[*debug])
|
||||
apimap := map[bool]func() interface{}{
|
||||
false: wcth,
|
||||
true: webstepsth,
|
||||
}
|
||||
cresp := apimap[*fwebsteps]()
|
||||
cresp := wcth()
|
||||
data, err := json.MarshalIndent(cresp, "", " ")
|
||||
runtimex.PanicOnError(err, "json.MarshalIndent failed")
|
||||
fmt.Printf("%s\n", string(data))
|
||||
}
|
||||
|
||||
func webstepsth() interface{} {
|
||||
serverURL := *server
|
||||
if serverURL == "" {
|
||||
serverURL = "https://1.th.ooni.org/api/v1/websteps"
|
||||
}
|
||||
clnt := &webstepsx.THClient{
|
||||
DNServers: []*measurex.ResolverInfo{{
|
||||
Network: "udp",
|
||||
Address: "8.8.4.4:53",
|
||||
}},
|
||||
HTTPClient: httpClient,
|
||||
ServerURL: serverURL,
|
||||
}
|
||||
cresp, err := clnt.Run(ctx, *target)
|
||||
runtimex.PanicOnError(err, "client.Run failed")
|
||||
return cresp
|
||||
}
|
||||
|
||||
func wcth() interface{} {
|
||||
serverURL := *server
|
||||
if serverURL == "" {
|
||||
|
||||
Reference in New Issue
Block a user