feat(ooapi): add toplevel client and simplify API (#248)

* feat(ooapi): add toplevel client and simplify API

This diff should simplify using ooapi from other packages by
adding more abstraction that wraps the existing code.

Part of https://github.com/ooni/probe/issues/1355.

* fix(ooapi): use correct comment for cloners

See https://github.com/ooni/probe-cli/pull/248#discussion_r590663843

* fix(ooapi): make sure the documentation is current

See https://github.com/ooni/probe-cli/pull/248#discussion_r590665773

* fix(ooapi): automate copying APIs

See https://github.com/ooni/probe-cli/pull/248#discussion_r590665837

* feat(ooapi): add unit tests for clientcall.go

See https://github.com/ooni/probe-cli/pull/248#discussion_r590666297

* fix(ooapi): rewrite integration tests to use toplevel API

See https://github.com/ooni/probe-cli/pull/248#discussion_r590665084
This commit is contained in:
Simone Basso 2021-03-19 09:30:42 +01:00 committed by GitHub
commit 28ce79eff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 2090 additions and 795 deletions

View file

@ -1,18 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
// 2021-02-26 15:45:52.108352268 +0100 CET m=+0.000275862
// 2021-03-10 13:17:33.849313529 +0100 CET m=+0.000136772
package ooapi
//go:generate go run ./internal/generator -file cloners.go
// PsiphonConfigCaller represents any type exposing a method
// like PsiphonConfigAPI.WithToken.
type PsiphonConfigCloner interface {
WithToken(token string) PsiphonConfigCaller
// clonerForPsiphonConfigAPI represents any type exposing a method
// like simplePsiphonConfigAPI.WithToken.
type clonerForPsiphonConfigAPI interface {
WithToken(token string) callerForPsiphonConfigAPI
}
// TorTargetsCaller represents any type exposing a method
// like TorTargetsAPI.WithToken.
type TorTargetsCloner interface {
WithToken(token string) TorTargetsCaller
// clonerForTorTargetsAPI represents any type exposing a method
// like simpleTorTargetsAPI.WithToken.
type clonerForTorTargetsAPI interface {
WithToken(token string) callerForTorTargetsAPI
}