feat(ExperimentOrchestraClient): add CheckIn (#263)
We use ExperimentOrchestraClient in several places to help us calling probe-services APIs. We need to call CheckIn because we want to use CheckIn in InputLoader. (We also want to remove the URLs API, but that is not something doable now, since the mobile app is still using this API via the wrappers at pkg/oonimkall.) Work part of https://github.com/ooni/probe/issues/1299.
This commit is contained in:
parent
576059b3fa
commit
3b029ee0d6
4 changed files with 22 additions and 1 deletions
|
|
@ -162,6 +162,8 @@ var _ torx.Session = &Session{}
|
|||
// ExperimentOrchestraClient is the experiment's view of
|
||||
// a client for querying the OONI orchestra.
|
||||
type ExperimentOrchestraClient struct {
|
||||
MockableCheckInInfo *model.CheckInInfo
|
||||
MockableCheckInErr error
|
||||
MockableFetchPsiphonConfigResult []byte
|
||||
MockableFetchPsiphonConfigErr error
|
||||
MockableFetchTorTargetsResult map[string]model.TorTarget
|
||||
|
|
@ -170,6 +172,12 @@ type ExperimentOrchestraClient struct {
|
|||
MockableFetchURLListErr error
|
||||
}
|
||||
|
||||
// CheckIn implements ExperimentOrchestraClient.CheckIn.
|
||||
func (c ExperimentOrchestraClient) CheckIn(
|
||||
ctx context.Context, config model.CheckInConfig) (*model.CheckInInfo, error) {
|
||||
return c.MockableCheckInInfo, c.MockableCheckInErr
|
||||
}
|
||||
|
||||
// FetchPsiphonConfig implements ExperimentOrchestraClient.FetchPsiphonConfig
|
||||
func (c ExperimentOrchestraClient) FetchPsiphonConfig(
|
||||
ctx context.Context) ([]byte, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue