Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename sessionresolver engineresolver #1264

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/engine/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (
"github.com/ooni/probe-cli/v3/internal/bytecounter"
"github.com/ooni/probe-cli/v3/internal/checkincache"
"github.com/ooni/probe-cli/v3/internal/enginelocate"
"github.com/ooni/probe-cli/v3/internal/engineresolver"
"github.com/ooni/probe-cli/v3/internal/kvstore"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/platform"
"github.com/ooni/probe-cli/v3/internal/probeservices"
"github.com/ooni/probe-cli/v3/internal/registry"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/sessionresolver"
"github.com/ooni/probe-cli/v3/internal/tunnel"
"github.com/ooni/probe-cli/v3/internal/version"
)
Expand Down Expand Up @@ -64,7 +64,7 @@ type Session struct {
logger model.Logger
proxyURL *url.URL
queryProbeServicesCount *atomic.Int64
resolver *sessionresolver.Resolver
resolver *engineresolver.Resolver
selectedProbeServiceHook func(*model.OOAPIService)
selectedProbeService *model.OOAPIService
softwareName string
Expand Down Expand Up @@ -132,8 +132,8 @@ type sessionProbeServicesClientForCheckIn interface {
//
// 5. Create a compound resolver for the session that will attempt
// to use a bunch of DoT/DoH servers before falling back to the system
// resolver if nothing else works (see the sessionresolver pkg). This
// sessionresolver will be using the configured proxy, if any.
// resolver if nothing else works (see the engineresolver pkg). This
// engineresolver will be using the configured proxy, if any.
//
// 6. Create the default HTTP transport that we should be using when
// we communicate with the OONI backends. This transport will be
Expand Down Expand Up @@ -208,7 +208,7 @@ func NewSession(ctx context.Context, config SessionConfig) (*Session, error) {
}
}
sess.proxyURL = proxyURL
sess.resolver = &sessionresolver.Resolver{
sess.resolver = &engineresolver.Resolver{
ByteCounter: sess.byteCounter,
KVStore: config.KVStore,
Logger: sess.logger,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package sessionresolver contains the resolver used by the session. This
// Package engineresolver contains the resolver used by the OONI engine. This
// resolver will try to figure out which is the best service for running
// domain name resolutions and will consistently use it.
//
Expand All @@ -21,4 +21,4 @@
// We also support a socks5 proxy. When such a proxy is configured,
// the code WILL skip http3 resolvers AS WELL AS the system
// resolver, in an attempt to avoid leaking your queries.
package sessionresolver
package engineresolver
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

//
// Error wrapping
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package sessionresolver_test
package engineresolver_test

import (
"context"
"testing"

"github.com/ooni/probe-cli/v3/internal/engineresolver"
"github.com/ooni/probe-cli/v3/internal/kvstore"
"github.com/ooni/probe-cli/v3/internal/sessionresolver"
)

func TestSessionResolverGood(t *testing.T) {
if testing.Short() {
t.Skip("skip test in short mode")
}
reso := &sessionresolver.Resolver{
reso := &engineresolver.Resolver{
KVStore: &kvstore.Memory{},
}
defer reso.CloseIdleConnections()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

//
// JSON codec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

//
// Actual lookup code
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

//
// Implementation of model.Resolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

//
// High-level code for creating a new child resolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"strings"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

//
// Persistent on-disk state
Expand All @@ -9,6 +9,9 @@ import (
"sort"
)

// TODO(bassosimone): we may want to change the key and rename or
// remove the old file inside the statedir

// storekey is the key used by the key value store to store
// the state required by this package.
const storekey = "sessionresolver.state"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sessionresolver
package engineresolver

import (
"errors"
Expand Down