From c25fff52b466952c5df561d522d6b4e3d021dd6d Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 16:37:37 -0800 Subject: [PATCH 01/23] move code to create user with backoff to pro client --- android/.project | 4 +- .../org.eclipse.buildship.core.prefs | 4 +- desktop/app/app.go | 125 ++++++------------ desktop/auth.go | 11 +- desktop/lib.go | 12 +- go.sum | 2 +- internalsdk/pro/pro.go | 2 + internalsdk/user.go | 59 --------- lib/core/service/websocket_subscriber.dart | 11 +- 9 files changed, 64 insertions(+), 166 deletions(-) diff --git a/android/.project b/android/.project index 09702ebb4..69f510cf3 100644 --- a/android/.project +++ b/android/.project @@ -16,12 +16,12 @@ - 1620924294143 + 1732230225439 30 org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs index c3298654d..33c657ef4 100644 --- a/android/.settings/org.eclipse.buildship.core.prefs +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -1,11 +1,11 @@ -arguments= +arguments=--init-script /var/folders/j5/yrnkkcxx6wlcr7h2f574qfjc0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/j5/yrnkkcxx6wlcr7h2f574qfjc0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle auto.sync=false build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home +java.home=/opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home jvm.arguments= offline.mode=false override.workspace.settings=true diff --git a/desktop/app/app.go b/desktop/app/app.go index 424ec036b..6c2f03197 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -562,17 +562,54 @@ func (app *App) IsPro() bool { return isPro } -func (app *App) fetchOrCreateUser(ctx context.Context) (*protos.User, error) { - settings := app.Settings() - lang := settings.GetLanguage() +func (app *App) fetchOrCreateUser(ctx context.Context) { + ss := app.Settings() + lang := ss.GetLanguage() if lang == "" { // set default language - settings.SetLanguage("en_us") + ss.SetLanguage("en_us") } - if userID := settings.GetUserID(); userID == 0 { - return app.CreateUser(ctx) + if userID := ss.GetUserID(); userID == 0 { + ss.SetUserFirstVisit(true) + app.proClient.RetryCreateUser(ctx, func(u *protos.User) { + ss.SetReferralCode(u.Referral) + ss.SetUserIDAndToken(u.UserId, u.Token) + }) } else { - return app.UserData(ctx) + app.proClient.PollUserData(ctx, func(u *protos.User) { + currentDevice := ss.GetDeviceID() + + // Check if device id is connect to same device if not create new user + // this is for the case when user removed device from other device + deviceFound := false + if u.Devices != nil { + for _, device := range u.Devices { + if device.Id == currentDevice { + deviceFound = true + break + } + } + } + /// Check if user has installed app first time + firstTime := ss.GetUserFirstVisit() + log.Debugf("First time visit %v", firstTime) + if u.UserLevel == "pro" && firstTime { + log.Debugf("User is pro and first time") + ss.SetProUser(true) + } else if u.UserLevel == "pro" && !firstTime && deviceFound { + log.Debugf("User is pro and not first time") + ss.SetProUser(true) + } else { + log.Debugf("User is not pro") + ss.SetProUser(false) + } + ss.SetUserIDAndToken(u.UserId, u.Token) + ss.SetExpiration(u.Expiration) + ss.SetReferralCode(u.Referral) + + app.SetUserData(ctx, u.UserId, u) + app.SendUpdateUserDataToUI() + }) } } @@ -592,27 +629,6 @@ func (app *App) fetchDeviceLinkingCode(ctx context.Context) (string, error) { return resp.Code, nil } -// CreateUser is used when Lantern is run for the first time and creates a new user with the pro server -func (app *App) CreateUser(ctx context.Context) (*protos.User, error) { - log.Debug("New user, calling user create") - settings := app.Settings() - settings.SetUserFirstVisit(true) - resp, err := app.proClient.UserCreate(ctx) - if err != nil { - return nil, errors.New("Could not create new Pro user: %v", err) - } - user := resp.User - log.Debugf("DEBUG: User created: %v", user) - if resp.BaseResponse != nil && resp.BaseResponse.Error != "" { - return nil, errors.New("Could not create new Pro user: %v", err) - } - app.SetUserData(ctx, user.UserId, user) - settings.SetReferralCode(user.Referral) - settings.SetUserIDAndToken(user.UserId, user.Token) - go app.UserData(ctx) - return resp.User, nil -} - // Plans returns the plans available to a user func (app *App) Plans(ctx context.Context) ([]protos.Plan, error) { if v, ok := app.plansCache.Load("plans"); ok { @@ -677,59 +693,6 @@ func (app *App) FetchPaymentMethods(ctx context.Context) (*proclient.PaymentMeth return resp, nil } -// UserData looks up user data that is associated with the given UserConfig -func (app *App) UserData(ctx context.Context) (*protos.User, error) { - log.Debug("Refreshing user data") - resp, err := app.proClient.UserData(context.Background()) - if err != nil { - return nil, errors.New("error fetching user data: %v", err) - } else if resp.User == nil { - return nil, errors.New("error fetching user data") - } - userDetail := resp.User - settings := app.Settings() - - setProUser := func(isPro bool) { - app.Settings().SetProUser(isPro) - } - - currentDevice := app.Settings().GetDeviceID() - - // Check if device id is connect to same device if not create new user - // this is for the case when user removed device from other device - deviceFound := false - if userDetail.Devices != nil { - for _, device := range userDetail.Devices { - if device.Id == currentDevice { - deviceFound = true - break - } - } - } - - /// Check if user has installed app first time - firstTime := settings.GetUserFirstVisit() - log.Debugf("First time visit %v", firstTime) - if userDetail.UserLevel == "pro" && firstTime { - log.Debugf("User is pro and first time") - setProUser(true) - } else if userDetail.UserLevel == "pro" && !firstTime && deviceFound { - log.Debugf("User is pro and not first time") - setProUser(true) - } else { - log.Debugf("User is not pro") - setProUser(false) - } - settings.SetUserIDAndToken(userDetail.UserId, userDetail.Token) - settings.SetExpiration(userDetail.Expiration) - settings.SetReferralCode(resp.User.Referral) - log.Debugf("User caching successful: %+v", userDetail) - // Save data in userData cache - app.SetUserData(ctx, userDetail.UserId, userDetail) - app.SendUpdateUserDataToUI() - return resp.User, nil -} - func (app *App) devices() protos.Devices { user, found := app.GetUserData(app.Settings().GetUserID()) diff --git a/desktop/auth.go b/desktop/auth.go index 5a6609e6b..944172eba 100644 --- a/desktop/auth.go +++ b/desktop/auth.go @@ -128,10 +128,6 @@ func logout() *C.char { } clearLocalUserData() - // Create new user - if _, err := a.CreateUser(ctx); err != nil { - return sendError(err) - } return C.CString("true") } @@ -253,7 +249,7 @@ func deleteAccount(password *C.char) *C.char { A: A.Bytes(), } log.Debugf("Delete Account request email %v A %v", lowerCaseEmail, A.Bytes()) - srpB, err := a.AuthClient().LoginPrepare(context.Background(), prepareRequestBody) + srpB, err := a.AuthClient().LoginPrepare(ctx, prepareRequestBody) if err != nil { return sendError(err) } @@ -309,10 +305,5 @@ func deleteAccount(password *C.char) *C.char { clearLocalUserData() // Set user id and token to nil a.Settings().SetUserIDAndToken(0, "") - // Create new user - // Create new user - if _, err := a.CreateUser(ctx); err != nil { - return sendError(err) - } return C.CString("true") } diff --git a/desktop/lib.go b/desktop/lib.go index add38e623..09837a841 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -151,20 +151,24 @@ func hasPlanUpdatedOrBuy() *C.char { //Get the cached user data log.Debugf("DEBUG: Checking if user has updated plan or bought new plan") cacheUserData, isOldFound := cachedUserData() + ctx := context.Background() //Get latest user data - resp, err := a.ProClient().UserData(context.Background()) + resp, err := a.ProClient().UserData(ctx) if err != nil { return sendError(err) } if isOldFound { - if cacheUserData.Expiration < resp.User.Expiration { + user := resp.User + log.Debugf("Expiration %v prev %v", user.Expiration, cacheUserData.Expiration) + if cacheUserData.Expiration < user.Expiration { // New data has a later expiration // if foud then update the cache - a.Settings().SetExpiration(resp.User.Expiration) + a.Settings().SetExpiration(user.Expiration) return C.CString(string("true")) } + a.SetUserData(ctx, user.UserId, user) } - return C.CString(string("false")) + return C.CString(string("true")) } //export applyRef diff --git a/go.sum b/go.sum index 6b19da269..1d07bd8df 100644 --- a/go.sum +++ b/go.sum @@ -293,7 +293,7 @@ github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731/go.mod h1:XZwE+ github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtAkb1OuOLBct/uFfL1p3XxAIcFct82GbT+UZM= github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= -github.com/getlantern/flashlight/v7 v7.6.136 h1:SlscKLFtKtTk6DgZOhgqiuys+hhLOqVrQwZQIQtlDDs= +github.com/getlantern/flashlight/v7 v7.6.136 h1:t5+Z/rFQ7PZrD5tUH3a1EeYgDgUi1io+nioI602Qp9Q= github.com/getlantern/flashlight/v7 v7.6.136/go.mod h1:PNDmAgH5Y3+Gi7Fnl05f1MW1joM+djK5ukKIaEjJMZA= github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw= github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI= diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index 0de1d51da..5dfa37c6c 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -37,7 +37,9 @@ type ProClient interface { PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) Plans(ctx context.Context) (*PlansResponse, error) + PollUserData(ctx context.Context, onUserData func(*protos.User)) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) + RetryCreateUser(ctx context.Context, onUserCreate func(*protos.User)) UserCreate(ctx context.Context) (*UserDataResponse, error) UserData(ctx context.Context) (*UserDataResponse, error) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) diff --git a/internalsdk/user.go b/internalsdk/user.go index a1f486220..9ebce511c 100644 --- a/internalsdk/user.go +++ b/internalsdk/user.go @@ -1,25 +1,11 @@ package internalsdk import ( - "context" "encoding/json" - "time" - "github.com/cenkalti/backoff/v4" - "github.com/getlantern/errors" "github.com/getlantern/lantern-client/internalsdk/common" - "github.com/getlantern/lantern-client/internalsdk/pro" ) -// ClientSession includes information needed to create a new client session -type ClientSession interface { - GetDeviceID() (string, error) - GetUserID() (int64, error) - GetToken() (string, error) - Locale() (string, error) - SetUserIdAndToken(int64, string) error -} - type userConfig struct { session PanickingSession } @@ -52,48 +38,3 @@ func (uc *userConfig) GetInternalHeaders() map[string]string { } return h } - -func newUserConfig(session PanickingSession) *userConfig { - return &userConfig{session: session} -} - -func createUser(ctx context.Context, proClient pro.ProClient, session ClientSession) error { - resp, err := proClient.UserCreate(ctx) - if err != nil { - log.Errorf("Error sending request: %v", err) - return err - } - user := resp.User - if user == nil || user.UserId == 0 { - log.Errorf("User not found in response") - return errors.New("User not found in response") - } - - // Save user id and token - session.SetUserIdAndToken(int64(user.UserId), user.Token) - log.Debugf("Created new Lantern user: %+v", user) - return nil -} - -// retryCreateUser is used to retry creating a user with an exponential backoff strategy -func retryCreateUser(ctx context.Context, session ClientSession) { - expBackoff := backoff.NewExponentialBackOff() - expBackoff.Multiplier = 2.0 - expBackoff.InitialInterval = 3 * time.Second - expBackoff.MaxInterval = 1 * time.Minute - expBackoff.MaxElapsedTime = 10 * time.Minute - expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval - proClient := createProClient(session, "android") - // Start retrying with exponential backoff - err := backoff.Retry(func() error { - err := createUser(ctx, proClient, session) - if err != nil { - return log.Errorf("Unable to create Lantern user: %v", err) - } - log.Debug("Successfully created user") - return nil - }, backoff.WithContext(expBackoff, ctx)) - if err != nil { - log.Fatal("Unable to create Lantern user after max retries") - } -} diff --git a/lib/core/service/websocket_subscriber.dart b/lib/core/service/websocket_subscriber.dart index 29b6b5ed0..5f462ea2c 100644 --- a/lib/core/service/websocket_subscriber.dart +++ b/lib/core/service/websocket_subscriber.dart @@ -88,12 +88,10 @@ class WebsocketSubscriber { final userStatus = message['userStatus']; final userLevel = message['userLevel']; final deviceLinkingCode = message['deviceLinkingCode']; - if (userLevel != null) { - if (userLevel == 'pro' || userStatus == 'active') { - sessionModel.proUserNotifier.value = true; - } else { - sessionModel.proUserNotifier.value = false; - } + final isLevelPro = userLevel != null && userLevel == 'pro'; + final isStatusPro = userStatus != null && userStatus == 'active'; + if (isLevelPro || isStatusPro) { + sessionModel.proUserNotifier.value = true; } if (deviceLinkingCode != null) { sessionModel.linkingCodeNotifier.value = deviceLinkingCode; @@ -142,7 +140,6 @@ class WebsocketSubscriber { } } - /// Method to update plans void _updatePlans(Map? plans) { if (plans != null) { From e11cc2744db0307c4be542dc4b19011d74a3a847 Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 16:37:52 -0800 Subject: [PATCH 02/23] move code to create user with backoff to pro client --- internalsdk/pro/user.go | 98 ++++++++++++++++++++++++++++++++++++ internalsdk/pro/user_test.go | 44 ++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 internalsdk/pro/user.go create mode 100644 internalsdk/pro/user_test.go diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go new file mode 100644 index 000000000..2e60b9c26 --- /dev/null +++ b/internalsdk/pro/user.go @@ -0,0 +1,98 @@ +package pro + +import ( + "context" + "fmt" + "time" + + "github.com/cenkalti/backoff/v4" + "github.com/getlantern/errors" + "github.com/getlantern/lantern-client/internalsdk/protos" +) + +// ClientSession includes information needed to create a new client session +type ClientSession interface { + GetDeviceID() (string, error) + GetUserID() (int64, error) + GetToken() (string, error) + Locale() (string, error) + SetUserIdAndToken(int64, string) error +} + +func (c *proClient) createUser(ctx context.Context, onUserCreate func(*protos.User)) error { + log.Debug("New user, calling user create") + resp, err := c.UserCreate(ctx) + if err != nil { + return errors.New("Could not create new Pro user: %v", err) + } + user := resp.User + log.Debugf("DEBUG: User created: %v", user) + if resp.BaseResponse != nil && resp.BaseResponse.Error != "" { + return errors.New("Could not create new Pro user: %v", err) + } + if onUserCreate != nil { + onUserCreate(resp.User) + } + return nil +} + +// RetryCreateUser is used to retry creating a user with an exponential backoff strategy +func (c *proClient) RetryCreateUser(ctx context.Context, onUserCreate func(*protos.User)) { + expBackoff := backoff.NewExponentialBackOff() + expBackoff.Multiplier = 2.0 + expBackoff.InitialInterval = 3 * time.Second + expBackoff.MaxInterval = 1 * time.Minute + expBackoff.MaxElapsedTime = 10 * time.Minute + expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval + err := backoff.Retry(func() error { + return c.createUser(ctx, onUserCreate) + }, backoff.WithContext(expBackoff, ctx)) + if err != nil { + log.Fatal("Unable to create Lantern user after max retries") + } +} + +func (c *proClient) updateUserData(ctx context.Context, onUserData func(*protos.User)) error { + resp, err := c.UserData(ctx) + if err != nil { + return errors.New("error fetching user data: %v", err) + } else if resp.User == nil { + return errors.New("error fetching user data") + } + if onUserData != nil { + onUserData(resp.User) + } + return nil +} + +// RetryCreateUser is used to retry creating a user with an exponential backoff strategy +func (c *proClient) PollUserData(ctx context.Context, onUserData func(*protos.User)) { + expBackoff := backoff.NewExponentialBackOff() + expBackoff.Multiplier = 2.0 + expBackoff.InitialInterval = 3 * time.Second + expBackoff.MaxInterval = 10 * time.Minute + expBackoff.MaxElapsedTime = 10 * time.Minute + expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval + timer := time.NewTimer(0) // Start immediately + defer timer.Stop() + + for { + select { + case <-ctx.Done(): + return + case <-timer.C: + // Wait for the timer to expire + c.updateUserData(ctx, onUserData) + + // Get the next backoff interval + waitTime := expBackoff.NextBackOff() + if waitTime == backoff.Stop { + expBackoff.Reset() + waitTime = expBackoff.NextBackOff() + } + fmt.Printf("Next attempt in %v...\n", waitTime) + // Reset the timer with the next backoff interval + timer.Reset(waitTime) + } + } +} diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go new file mode 100644 index 000000000..64c8c24a6 --- /dev/null +++ b/internalsdk/pro/user_test.go @@ -0,0 +1,44 @@ +package pro + +import ( + "context" + "testing" + + "github.com/getlantern/errors" + "github.com/getlantern/lantern-client/internalsdk/mocks" + "github.com/getlantern/lantern-client/internalsdk/protos" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func TestCreateUser_Success(t *testing.T) { + + mockProClient := new(mocks.ProClient) + mockSession := new(mocks.Session) + + // Set up expected behavior + mockProClient.On("UserCreate", mock.Anything).Return(&UserDataResponse{ + User: &protos.User{ + UserId: 123, + Token: "test-token", + }, + }, nil) + mockSession.On("SetUserIdAndToken", int64(123), "test-token").Return(nil) + + err := createUser(context.Background(), mockProClient, mockSession) + assert.NoError(t, err, "expected no error") + // Verify that UserCreate and SetUserIdAndToken were called once + mockProClient.AssertCalled(t, "UserCreate", mock.Anything) + mockSession.AssertCalled(t, "SetUserIdAndToken", int64(123), "test-token") +} + +func TestCreateUser_Failure(t *testing.T) { + mockProClient := new(mocks.ProClient) + mockSession := new(mocks.Session) + + mockProClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) + + err := createUser(context.Background(), mockProClient, mockSession) + assert.Error(t, err, "expected an error") + mockProClient.AssertCalled(t, "UserCreate", mock.Anything) +} From aa953c96610ad6785685fc974d52c81e33c84e3f Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 16:50:30 -0800 Subject: [PATCH 03/23] move create user code to pro client --- desktop/app/app.go | 37 ++--------------------- desktop/lib.go | 4 --- internalsdk/pro/pro.go | 4 +-- internalsdk/pro/user.go | 65 +++++++++++++++++++++++++++++++---------- 4 files changed, 53 insertions(+), 57 deletions(-) diff --git a/desktop/app/app.go b/desktop/app/app.go index 6c2f03197..c9319c0fc 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -571,42 +571,9 @@ func (app *App) fetchOrCreateUser(ctx context.Context) { } if userID := ss.GetUserID(); userID == 0 { ss.SetUserFirstVisit(true) - app.proClient.RetryCreateUser(ctx, func(u *protos.User) { - ss.SetReferralCode(u.Referral) - ss.SetUserIDAndToken(u.UserId, u.Token) - }) + app.proClient.RetryCreateUser(ctx, ss) } else { - app.proClient.PollUserData(ctx, func(u *protos.User) { - currentDevice := ss.GetDeviceID() - - // Check if device id is connect to same device if not create new user - // this is for the case when user removed device from other device - deviceFound := false - if u.Devices != nil { - for _, device := range u.Devices { - if device.Id == currentDevice { - deviceFound = true - break - } - } - } - /// Check if user has installed app first time - firstTime := ss.GetUserFirstVisit() - log.Debugf("First time visit %v", firstTime) - if u.UserLevel == "pro" && firstTime { - log.Debugf("User is pro and first time") - ss.SetProUser(true) - } else if u.UserLevel == "pro" && !firstTime && deviceFound { - log.Debugf("User is pro and not first time") - ss.SetProUser(true) - } else { - log.Debugf("User is not pro") - ss.SetProUser(false) - } - ss.SetUserIDAndToken(u.UserId, u.Token) - ss.SetExpiration(u.Expiration) - ss.SetReferralCode(u.Referral) - + app.proClient.PollUserData(ctx, ss, func(u *protos.User) { app.SetUserData(ctx, u.UserId, u) app.SendUpdateUserDataToUI() }) diff --git a/desktop/lib.go b/desktop/lib.go index 09837a841..27b8bf6fa 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -159,14 +159,12 @@ func hasPlanUpdatedOrBuy() *C.char { } if isOldFound { user := resp.User - log.Debugf("Expiration %v prev %v", user.Expiration, cacheUserData.Expiration) if cacheUserData.Expiration < user.Expiration { // New data has a later expiration // if foud then update the cache a.Settings().SetExpiration(user.Expiration) return C.CString(string("true")) } - a.SetUserData(ctx, user.UserId, user) } return C.CString(string("true")) } @@ -272,8 +270,6 @@ func testProviderRequest(email *C.char, paymentProvider *C.char, plan *C.char) * if err != nil { return sendError(err) } - //a.SetProUser(true) - go a.UserData(ctx) return C.CString("true") } diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index 5dfa37c6c..1fb2ce835 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -37,9 +37,9 @@ type ProClient interface { PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) Plans(ctx context.Context) (*PlansResponse, error) - PollUserData(ctx context.Context, onUserData func(*protos.User)) + PollUserData(ctx context.Context, session ClientSession, onUserData func(*protos.User)) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) - RetryCreateUser(ctx context.Context, onUserCreate func(*protos.User)) + RetryCreateUser(ctx context.Context, session ClientSession) UserCreate(ctx context.Context) (*UserDataResponse, error) UserData(ctx context.Context) (*UserDataResponse, error) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index 2e60b9c26..7b63bb7c6 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -10,16 +10,20 @@ import ( "github.com/getlantern/lantern-client/internalsdk/protos" ) -// ClientSession includes information needed to create a new client session +// ClientSession includes information needed to createa new client session type ClientSession interface { - GetDeviceID() (string, error) - GetUserID() (int64, error) - GetToken() (string, error) - Locale() (string, error) - SetUserIdAndToken(int64, string) error + GetDeviceID() string + GetUserFirstVisit() bool + GetUserID() int64 + GetToken() string + //Locale() string + SetExpiration(int64) + SetProUser(bool) + SetReferralCode(string) + SetUserIDAndToken(int64, string) } -func (c *proClient) createUser(ctx context.Context, onUserCreate func(*protos.User)) error { +func (c *proClient) createUser(ctx context.Context, session ClientSession) error { log.Debug("New user, calling user create") resp, err := c.UserCreate(ctx) if err != nil { @@ -30,14 +34,13 @@ func (c *proClient) createUser(ctx context.Context, onUserCreate func(*protos.Us if resp.BaseResponse != nil && resp.BaseResponse.Error != "" { return errors.New("Could not create new Pro user: %v", err) } - if onUserCreate != nil { - onUserCreate(resp.User) - } + session.SetReferralCode(user.Referral) + session.SetUserIDAndToken(user.UserId, user.Token) return nil } // RetryCreateUser is used to retry creating a user with an exponential backoff strategy -func (c *proClient) RetryCreateUser(ctx context.Context, onUserCreate func(*protos.User)) { +func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession) { expBackoff := backoff.NewExponentialBackOff() expBackoff.Multiplier = 2.0 expBackoff.InitialInterval = 3 * time.Second @@ -45,28 +48,58 @@ func (c *proClient) RetryCreateUser(ctx context.Context, onUserCreate func(*prot expBackoff.MaxElapsedTime = 10 * time.Minute expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval err := backoff.Retry(func() error { - return c.createUser(ctx, onUserCreate) + return c.createUser(ctx, ss) }, backoff.WithContext(expBackoff, ctx)) if err != nil { log.Fatal("Unable to create Lantern user after max retries") } } -func (c *proClient) updateUserData(ctx context.Context, onUserData func(*protos.User)) error { +func (c *proClient) updateUserData(ctx context.Context, ss ClientSession, onUserData func(*protos.User)) error { resp, err := c.UserData(ctx) if err != nil { return errors.New("error fetching user data: %v", err) } else if resp.User == nil { return errors.New("error fetching user data") } + user := resp.User + currentDevice := ss.GetDeviceID() + + // Check if device id is connect to same device if not create new user + // this is for the case when user removed device from other device + deviceFound := false + if user.Devices != nil { + for _, device := range user.Devices { + if device.Id == currentDevice { + deviceFound = true + break + } + } + } + /// Check if user has installed app first time + firstTime := ss.GetUserFirstVisit() + log.Debugf("First time visit %v", firstTime) + if user.UserLevel == "pro" && firstTime { + log.Debugf("User is pro and first time") + ss.SetProUser(true) + } else if user.UserLevel == "pro" && !firstTime && deviceFound { + log.Debugf("User is pro and not first time") + ss.SetProUser(true) + } else { + log.Debugf("User is not pro") + ss.SetProUser(false) + } + ss.SetUserIDAndToken(user.UserId, user.Token) + ss.SetExpiration(user.Expiration) + ss.SetReferralCode(user.Referral) if onUserData != nil { - onUserData(resp.User) + onUserData(user) } return nil } // RetryCreateUser is used to retry creating a user with an exponential backoff strategy -func (c *proClient) PollUserData(ctx context.Context, onUserData func(*protos.User)) { +func (c *proClient) PollUserData(ctx context.Context, session ClientSession, onUserData func(*protos.User)) { expBackoff := backoff.NewExponentialBackOff() expBackoff.Multiplier = 2.0 expBackoff.InitialInterval = 3 * time.Second @@ -82,7 +115,7 @@ func (c *proClient) PollUserData(ctx context.Context, onUserData func(*protos.Us return case <-timer.C: // Wait for the timer to expire - c.updateUserData(ctx, onUserData) + c.updateUserData(ctx, session, onUserData) // Get the next backoff interval waitTime := expBackoff.NextBackOff() From c28bde94f83655d63e871cdbb95983a9a99b803e Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 17:17:06 -0800 Subject: [PATCH 04/23] clean-ups --- desktop/app/app.go | 5 +---- desktop/lib.go | 8 ++++++-- internalsdk/pro/pro.go | 10 +++++++--- internalsdk/pro/user.go | 44 +++++++++++++++++++++++++++++++---------- 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/desktop/app/app.go b/desktop/app/app.go index c9319c0fc..6175a6901 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -573,10 +573,7 @@ func (app *App) fetchOrCreateUser(ctx context.Context) { ss.SetUserFirstVisit(true) app.proClient.RetryCreateUser(ctx, ss) } else { - app.proClient.PollUserData(ctx, ss, func(u *protos.User) { - app.SetUserData(ctx, u.UserId, u) - app.SendUpdateUserDataToUI() - }) + app.proClient.UpdateUserData(ctx, ss) } } diff --git a/desktop/lib.go b/desktop/lib.go index 27b8bf6fa..4f7e0ff5c 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -148,10 +148,11 @@ func setProxyAll(value *C.char) { // //export hasPlanUpdatedOrBuy func hasPlanUpdatedOrBuy() *C.char { + ctx := context.Background() + go a.ProClient().PollUserData(ctx, a.Settings(), nil) //Get the cached user data log.Debugf("DEBUG: Checking if user has updated plan or bought new plan") cacheUserData, isOldFound := cachedUserData() - ctx := context.Background() //Get latest user data resp, err := a.ProClient().UserData(ctx) if err != nil { @@ -383,7 +384,8 @@ func deviceLinkingCode() *C.char { //export paymentRedirect func paymentRedirect(planID, currency, provider, email, deviceName *C.char) *C.char { country := a.Settings().GetCountry() - resp, err := a.ProClient().PaymentRedirect(context.Background(), &protos.PaymentRedirectRequest{ + ctx := context.Background() + resp, err := a.ProClient().PaymentRedirect(ctx, &protos.PaymentRedirectRequest{ Plan: C.GoString(planID), Provider: C.GoString(provider), Currency: strings.ToUpper(C.GoString(currency)), @@ -394,6 +396,8 @@ func paymentRedirect(planID, currency, provider, email, deviceName *C.char) *C.c if err != nil { return sendError(err) } + + go a.ProClient().PollUserData(ctx, a.Settings(), nil) return sendJson(resp) } diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index 1fb2ce835..69ac1e36b 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -27,7 +27,8 @@ var ( type proClient struct { webclient.RESTClient - userConfig func() common.UserConfig + backoffRunner *backoffRunner + userConfig func() common.UserConfig } type ProClient interface { @@ -42,6 +43,7 @@ type ProClient interface { RetryCreateUser(ctx context.Context, session ClientSession) UserCreate(ctx context.Context) (*UserDataResponse, error) UserData(ctx context.Context) (*UserDataResponse, error) + UpdateUserData(ctx context.Context, ss ClientSession) (*protos.User, error) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) RestorePurchase(ctx context.Context, req map[string]interface{}) (*OkResponse, error) EmailRequest(ctx context.Context, email string) (*OkResponse, error) @@ -70,9 +72,11 @@ func NewClient(baseURL string, opts *webclient.Opts) ProClient { return nil } } + return &proClient{ - userConfig: opts.UserConfig, - RESTClient: webclient.NewRESTClient(opts), + userConfig: opts.UserConfig, + backoffRunner: &backoffRunner{}, + RESTClient: webclient.NewRESTClient(opts), } } diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index 7b63bb7c6..472207e53 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -3,6 +3,7 @@ package pro import ( "context" "fmt" + "sync" "time" "github.com/cenkalti/backoff/v4" @@ -23,6 +24,11 @@ type ClientSession interface { SetUserIDAndToken(int64, string) } +type backoffRunner struct { + mu sync.Mutex + isRunning bool +} + func (c *proClient) createUser(ctx context.Context, session ClientSession) error { log.Debug("New user, calling user create") resp, err := c.UserCreate(ctx) @@ -55,12 +61,12 @@ func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession) { } } -func (c *proClient) updateUserData(ctx context.Context, ss ClientSession, onUserData func(*protos.User)) error { +func (c *proClient) UpdateUserData(ctx context.Context, ss ClientSession) (*protos.User, error) { resp, err := c.UserData(ctx) if err != nil { - return errors.New("error fetching user data: %v", err) + return nil, errors.New("error fetching user data: %v", err) } else if resp.User == nil { - return errors.New("error fetching user data") + return nil, errors.New("error fetching user data") } user := resp.User currentDevice := ss.GetDeviceID() @@ -92,18 +98,30 @@ func (c *proClient) updateUserData(ctx context.Context, ss ClientSession, onUser ss.SetUserIDAndToken(user.UserId, user.Token) ss.SetExpiration(user.Expiration) ss.SetReferralCode(user.Referral) - if onUserData != nil { - onUserData(user) - } - return nil + return user, nil } // RetryCreateUser is used to retry creating a user with an exponential backoff strategy func (c *proClient) PollUserData(ctx context.Context, session ClientSession, onUserData func(*protos.User)) { + b := c.backoffRunner + b.mu.Lock() + if b.isRunning { + b.mu.Unlock() + return + } + b.isRunning = true + b.mu.Unlock() + + defer func() { + b.mu.Lock() + b.isRunning = false + b.mu.Unlock() + }() + expBackoff := backoff.NewExponentialBackOff() expBackoff.Multiplier = 2.0 - expBackoff.InitialInterval = 3 * time.Second - expBackoff.MaxInterval = 10 * time.Minute + expBackoff.InitialInterval = 10 * time.Second + expBackoff.MaxInterval = 2 * time.Minute expBackoff.MaxElapsedTime = 10 * time.Minute expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval timer := time.NewTimer(0) // Start immediately @@ -112,10 +130,16 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, onU for { select { case <-ctx.Done(): + fmt.Println("Task cancelled:", ctx.Err()) return case <-timer.C: // Wait for the timer to expire - c.updateUserData(ctx, session, onUserData) + user, err := c.UpdateUserData(ctx, session) + if err != nil { + log.Error(err) + } else if onUserData != nil { + onUserData(user) + } // Get the next backoff interval waitTime := expBackoff.NextBackOff() From 1b45fb04cbdef8b2839796dfcbc30765b43fc8ff Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 20:48:05 -0800 Subject: [PATCH 05/23] Update desktop to use same code to retry creating user --- Makefile | 6 +- desktop/app/app.go | 2 +- desktop/lib.go | 3 +- desktop/settings/settings.go | 5 + internalsdk/android.go | 44 +- internalsdk/android_test.go | 6 +- internalsdk/issue.go | 2 +- internalsdk/mocks/Session.go | 717 ------------------------------- internalsdk/mocks/ad_provider.go | 96 ----- internalsdk/mocks/ad_settings.go | 56 --- internalsdk/mocks/pro_client.go | 687 ----------------------------- internalsdk/pro/pro.go | 7 +- internalsdk/pro/user.go | 53 ++- internalsdk/pro/user_test.go | 32 +- internalsdk/session_model.go | 58 +-- internalsdk/user_test.go | 45 -- internalsdk/utils.go | 2 +- 17 files changed, 146 insertions(+), 1675 deletions(-) delete mode 100644 internalsdk/mocks/Session.go delete mode 100644 internalsdk/mocks/ad_provider.go delete mode 100644 internalsdk/mocks/ad_settings.go delete mode 100644 internalsdk/mocks/pro_client.go delete mode 100644 internalsdk/user_test.go diff --git a/Makefile b/Makefile index ead8c18f2..72f807acf 100644 --- a/Makefile +++ b/Makefile @@ -462,12 +462,14 @@ ios-release: set-version guard-SENTRY_AUTH_TOKEN guard-SENTRY_ORG guard-SENTRY_P ## Mocks MOCKERY=mockery -MOCKERY_FLAGS=--case=underscore --output=internalsdk/mocks --outpkg=mocks +MOCKERY_FLAGS=--case=underscore --output=./internalsdk/mocks --outpkg=mocks --with-expecter .PHONY: mocks mocks: @$(MOCKERY) --name=AdProvider --name=AdSettings --name=Session --dir=./internalsdk $(MOCKERY_FLAGS) - @$(MOCKERY) --name=ProClient --dir=./internalsdk/pro $(MOCKERY_FLAGS) + @$(MOCKERY) --name=ProClient --dir=./internalsdk/pro --outpkg=pro --output=./internalsdk/pro --structname=MockProClient + @$(MOCKERY) --name=ClientSession --dir=./internalsdk/pro --outpkg=pro --output=./internalsdk/pro $(MOCKERY_FLAGS) + .PHONY: echo-build-tags echo-build-tags: ## Prints build tags and extra ldflags. Run this with `REPLICA=1 make echo-build-tags` for example to see how it changes diff --git a/desktop/app/app.go b/desktop/app/app.go index 6175a6901..0e1f3be1a 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -571,7 +571,7 @@ func (app *App) fetchOrCreateUser(ctx context.Context) { } if userID := ss.GetUserID(); userID == 0 { ss.SetUserFirstVisit(true) - app.proClient.RetryCreateUser(ctx, ss) + app.proClient.RetryCreateUser(ctx, ss, 5*time.Minute) } else { app.proClient.UpdateUserData(ctx, ss) } diff --git a/desktop/lib.go b/desktop/lib.go index 4f7e0ff5c..2473a405a 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -149,7 +149,7 @@ func setProxyAll(value *C.char) { //export hasPlanUpdatedOrBuy func hasPlanUpdatedOrBuy() *C.char { ctx := context.Background() - go a.ProClient().PollUserData(ctx, a.Settings(), nil) + go a.ProClient().PollUserData(ctx, a.Settings(), 10*time.Minute) //Get the cached user data log.Debugf("DEBUG: Checking if user has updated plan or bought new plan") cacheUserData, isOldFound := cachedUserData() @@ -397,7 +397,6 @@ func paymentRedirect(planID, currency, provider, email, deviceName *C.char) *C.c return sendError(err) } - go a.ProClient().PollUserData(ctx, a.Settings(), nil) return sendJson(resp) } diff --git a/desktop/settings/settings.go b/desktop/settings/settings.go index 211da14d8..ffb29c6e6 100644 --- a/desktop/settings/settings.go +++ b/desktop/settings/settings.go @@ -508,6 +508,11 @@ func (s *Settings) GetLanguage() string { return s.getString(SNLanguage) } +// Locale returns the user language +func (s *Settings) Locale() string { + return s.getString(SNLanguage) +} + // SetReferralCode sets the user referral code func (s *Settings) SetReferralCode(referralCode string) { s.setVal(SNReferralCode, referralCode) diff --git a/internalsdk/android.go b/internalsdk/android.go index 8d405a03c..0d5a7fd59 100644 --- a/internalsdk/android.go +++ b/internalsdk/android.go @@ -78,10 +78,17 @@ type AdProvider interface { // thrown from the Java code. If a method interface doesn't include an error, exceptions on the // Java side immediately result in a panic from which Go cannot recover. type Session interface { - ClientSession + GetDeviceID() (string, error) + GetUserID() (int64, error) + GetToken() (string, error) + Locale() (string, error) + GetUserFirstVisit() (bool, error) GetAppName() string SetCountry(string) error + SetExpiration(int64) error SetIP(string) error + SetReferralCode(string) error + SetProUser(bool) error UpdateAdSettings(AdSettings) error UpdateStats(serverCity string, serverCountry string, serverCountryCode string, p3 int, p4 int, hasSucceedingProxy bool) error SetStaging(bool) error @@ -105,7 +112,7 @@ type Session interface { SetShowGoogleAds(bool) SetHasConfigFetched(bool) SetHasProxyFetched(bool) - SetUserIdAndToken(int64, string) error + SetUserIDAndToken(int64, string) error SetOnSuccess(bool) ChatEnable() bool // workaround for lack of any sequence types in gomobile bind... ;_; @@ -117,9 +124,11 @@ type Session interface { // PanickingSession wraps the Session interface but panics instead of returning errors type PanickingSession interface { common.AuthConfig + GetUserFirstVisit() bool SetCountry(string) UpdateAdSettings(AdSettings) UpdateStats(string, string, string, int, int, bool) + SetExpiration(int64) SetStaging(bool) BandwidthUpdate(int, int, int, int) Locale() string @@ -145,7 +154,9 @@ type PanickingSession interface { SerializedInternalHeaders() string SetHasConfigFetched(bool) SetHasProxyFetched(bool) - SetUserIdAndToken(int64, string) + SetProUser(bool) + SetReferralCode(string) + SetUserIDAndToken(int64, string) SetOnSuccess(bool) ChatEnable() bool @@ -183,10 +194,28 @@ func (s *panickingSessionImpl) GetToken() string { return result } +func (s *panickingSessionImpl) GetUserFirstVisit() bool { + result, err := s.wrapped.GetUserFirstVisit() + panicIfNecessary(err) + return result +} + func (s *panickingSessionImpl) SetCountry(country string) { panicIfNecessary(s.wrapped.SetCountry(country)) } +func (s *panickingSessionImpl) SetExpiration(expiration int64) { + panicIfNecessary(s.wrapped.SetExpiration(expiration)) +} + +func (s *panickingSessionImpl) SetProUser(proUser bool) { + panicIfNecessary(s.wrapped.SetProUser(proUser)) +} + +func (s *panickingSessionImpl) SetReferralCode(referralCode string) { + panicIfNecessary(s.wrapped.SetReferralCode(referralCode)) +} + func (s *panickingSessionImpl) SetIP(ipAddress string) { panicIfNecessary(s.wrapped.SetIP(ipAddress)) } @@ -300,8 +329,8 @@ func (s *panickingSessionImpl) SetShowGoogleAds(enabled bool) { s.wrapped.SetShowGoogleAds(enabled) } -func (s *panickingSessionImpl) SetUserIdAndToken(userID int64, token string) { - err := s.wrapped.SetUserIdAndToken(userID, token) +func (s *panickingSessionImpl) SetUserIDAndToken(userID int64, token string) { + err := s.wrapped.SetUserIDAndToken(userID, token) panicIfNecessary(err) } @@ -538,7 +567,7 @@ func run(configDir, locale string, settings Settings, wrappedSession Session) { config.ForceCountry(forcedCountryCode) } - userConfig := newUserConfig(session) + userConfig := &userConfig{session: session} globalConfigChanged := make(chan interface{}) geoRefreshed := geolookup.OnRefresh() @@ -683,7 +712,8 @@ func afterStart(wrappedSession Session, session PanickingSession) { if session.GetUserID() == 0 { ctx := context.Background() - go retryCreateUser(ctx, wrappedSession) + proClient := createProClient(wrappedSession, "android") + go proClient.RetryCreateUser(ctx, session, 10*time.Minute) } bandwidthUpdates(session) diff --git a/internalsdk/android_test.go b/internalsdk/android_test.go index 523d49bf0..b501323c0 100644 --- a/internalsdk/android_test.go +++ b/internalsdk/android_test.go @@ -61,6 +61,7 @@ func (c testSession) UpdateStats(string, string, string, int, int, bool) error { func (c testSession) UpdateAdSettings(AdSettings) error { return nil } func (c testSession) GetAppName() string { return "lantern" } +func (c testSession) GetUserFirstVisit() (bool, error) { return false, nil } func (c testSession) AppVersion() (string, error) { return "6.9.0", nil } func (c testSession) Code() (string, error) { return "1", nil } func (c testSession) Currency() (string, error) { return "usd", nil } @@ -70,9 +71,12 @@ func (c testSession) GetCountryCode() (string, error) { retur func (c testSession) IsStoreVersion() (bool, error) { return false, nil } func (c testSession) Provider() (string, error) { return "stripe", nil } func (c testSession) SetChatEnabled(enabled bool) {} -func (c testSession) SetUserIdAndToken(userId int64, token string) error { return nil } +func (c testSession) SetUserIDAndToken(userId int64, token string) error { return nil } func (c testSession) SetAuthEnabled(enabled bool) {} func (c testSession) SetMatomoEnabled(bool) {} +func (c testSession) SetExpiration(expiration int64) error { return nil } +func (c testSession) SetProUser(proUser bool) error { return nil } +func (c testSession) SetReferralCode(referralCode string) error { return nil } func (c testSession) IsPlayVersion() (bool, error) { return false, nil } func (c testSession) SetShowGoogleAds(enabled bool) {} func (c testSession) SetHasConfigFetched(enabled bool) {} diff --git a/internalsdk/issue.go b/internalsdk/issue.go index f09e844a7..f162deb03 100644 --- a/internalsdk/issue.go +++ b/internalsdk/issue.go @@ -35,7 +35,7 @@ func SendIssueReport( return err } return issue.SendReport( - newUserConfig(&panickingSessionImpl{session}), + &userConfig{&panickingSessionImpl{session}}, issueTypeInt, description, subscriptionLevel, diff --git a/internalsdk/mocks/Session.go b/internalsdk/mocks/Session.go deleted file mode 100644 index c7b031605..000000000 --- a/internalsdk/mocks/Session.go +++ /dev/null @@ -1,717 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" -) - -// Session is an autogenerated mock type for the Session type -type Session struct { - mock.Mock -} - -// BandwidthUpdate provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *Session) BandwidthUpdate(_a0 int, _a1 int, _a2 int, _a3 int) error { - ret := _m.Called(_a0, _a1, _a2, _a3) - - if len(ret) == 0 { - panic("no return value specified for BandwidthUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int, int, int, int) error); ok { - r0 = rf(_a0, _a1, _a2, _a3) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ChatEnable provides a mock function with given fields: -func (_m *Session) ChatEnable() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ChatEnable") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Code provides a mock function with given fields: -func (_m *Session) Code() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Code") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Currency provides a mock function with given fields: -func (_m *Session) Currency() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Currency") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeviceOS provides a mock function with given fields: -func (_m *Session) DeviceOS() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DeviceOS") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Email provides a mock function with given fields: -func (_m *Session) Email() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Email") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ForceReplica provides a mock function with given fields: -func (_m *Session) ForceReplica() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ForceReplica") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// GetAppName provides a mock function with given fields: -func (_m *Session) GetAppName() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAppName") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// GetCountryCode provides a mock function with given fields: -func (_m *Session) GetCountryCode() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetCountryCode") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetDNSServer provides a mock function with given fields: -func (_m *Session) GetDNSServer() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetDNSServer") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetDeviceID provides a mock function with given fields: -func (_m *Session) GetDeviceID() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetDeviceID") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetForcedCountryCode provides a mock function with given fields: -func (_m *Session) GetForcedCountryCode() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetForcedCountryCode") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetTimeZone provides a mock function with given fields: -func (_m *Session) GetTimeZone() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTimeZone") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetToken provides a mock function with given fields: -func (_m *Session) GetToken() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetToken") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetUserID provides a mock function with given fields: -func (_m *Session) GetUserID() (int64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetUserID") - } - - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func() (int64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// IsProUser provides a mock function with given fields: -func (_m *Session) IsProUser() (bool, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsProUser") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func() (bool, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// IsStoreVersion provides a mock function with given fields: -func (_m *Session) IsStoreVersion() (bool, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsStoreVersion") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func() (bool, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Locale provides a mock function with given fields: -func (_m *Session) Locale() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Locale") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Provider provides a mock function with given fields: -func (_m *Session) Provider() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Provider") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SerializedInternalHeaders provides a mock function with given fields: -func (_m *Session) SerializedInternalHeaders() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SerializedInternalHeaders") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SetAuthEnabled provides a mock function with given fields: _a0 -func (_m *Session) SetAuthEnabled(_a0 bool) { - _m.Called(_a0) -} - -// SetChatEnabled provides a mock function with given fields: _a0 -func (_m *Session) SetChatEnabled(_a0 bool) { - _m.Called(_a0) -} - -// SetCountry provides a mock function with given fields: _a0 -func (_m *Session) SetCountry(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetCountry") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SetHasConfigFetched provides a mock function with given fields: _a0 -func (_m *Session) SetHasConfigFetched(_a0 bool) { - _m.Called(_a0) -} - -// SetHasProxyFetched provides a mock function with given fields: _a0 -func (_m *Session) SetHasProxyFetched(_a0 bool) { - _m.Called(_a0) -} - -// SetIP provides a mock function with given fields: _a0 -func (_m *Session) SetIP(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetIP") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SetOnSuccess provides a mock function with given fields: _a0 -func (_m *Session) SetOnSuccess(_a0 bool) { - _m.Called(_a0) -} - -// SetReplicaAddr provides a mock function with given fields: _a0 -func (_m *Session) SetReplicaAddr(_a0 string) { - _m.Called(_a0) -} - -// SetShowGoogleAds provides a mock function with given fields: _a0 -func (_m *Session) SetShowGoogleAds(_a0 bool) { - _m.Called(_a0) -} - -// SetStaging provides a mock function with given fields: _a0 -func (_m *Session) SetStaging(_a0 bool) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetStaging") - } - - var r0 error - if rf, ok := ret.Get(0).(func(bool) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SetUserIdAndToken provides a mock function with given fields: _a0, _a1 -func (_m *Session) SetUserIdAndToken(_a0 int64, _a1 string) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SetUserIdAndToken") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SplitTunnelingEnabled provides a mock function with given fields: -func (_m *Session) SplitTunnelingEnabled() (bool, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SplitTunnelingEnabled") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func() (bool, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UpdateAdSettings provides a mock function with given fields: _a0 -func (_m *Session) UpdateAdSettings(_a0 AdSettings) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UpdateAdSettings") - } - - var r0 error - if rf, ok := ret.Get(0).(func(AdSettings) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UpdateStats provides a mock function with given fields: serverCity, serverCountry, serverCountryCode, p3, p4, hasSucceedingProxy -func (_m *Session) UpdateStats(serverCity string, serverCountry string, serverCountryCode string, p3 int, p4 int, hasSucceedingProxy bool) error { - ret := _m.Called(serverCity, serverCountry, serverCountryCode, p3, p4, hasSucceedingProxy) - - if len(ret) == 0 { - panic("no return value specified for UpdateStats") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, string, string, int, int, bool) error); ok { - r0 = rf(serverCity, serverCountry, serverCountryCode, p3, p4, hasSucceedingProxy) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewSession creates a new instance of Session. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSession(t interface { - mock.TestingT - Cleanup(func()) -}) *Session { - mock := &Session{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internalsdk/mocks/ad_provider.go b/internalsdk/mocks/ad_provider.go deleted file mode 100644 index ea9ef82be..000000000 --- a/internalsdk/mocks/ad_provider.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// AdProvider is an autogenerated mock type for the AdProvider type -type AdProvider struct { - mock.Mock -} - -// GetInterstitialZoneID provides a mock function with given fields: -func (_m *AdProvider) GetInterstitialZoneID() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetInterstitialZoneID") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// GetNativeBannerZoneID provides a mock function with given fields: -func (_m *AdProvider) GetNativeBannerZoneID() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNativeBannerZoneID") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// GetStandardBannerZoneID provides a mock function with given fields: -func (_m *AdProvider) GetStandardBannerZoneID() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStandardBannerZoneID") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// ShouldShowAd provides a mock function with given fields: -func (_m *AdProvider) ShouldShowAd() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ShouldShowAd") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// NewAdProvider creates a new instance of AdProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewAdProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *AdProvider { - mock := &AdProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internalsdk/mocks/ad_settings.go b/internalsdk/mocks/ad_settings.go deleted file mode 100644 index 1a174a5f6..000000000 --- a/internalsdk/mocks/ad_settings.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" -) - -// AdSettings is an autogenerated mock type for the AdSettings type -type AdSettings struct { - mock.Mock -} - -// GetAdProvider provides a mock function with given fields: isPro, countryCode, daysSinceInstalled -func (_m *AdSettings) GetAdProvider(isPro bool, countryCode string, daysSinceInstalled int) (AdProvider, error) { - ret := _m.Called(isPro, countryCode, daysSinceInstalled) - - if len(ret) == 0 { - panic("no return value specified for GetAdProvider") - } - - var r0 AdProvider - var r1 error - if rf, ok := ret.Get(0).(func(bool, string, int) (AdProvider, error)); ok { - return rf(isPro, countryCode, daysSinceInstalled) - } - if rf, ok := ret.Get(0).(func(bool, string, int) AdProvider); ok { - r0 = rf(isPro, countryCode, daysSinceInstalled) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(AdProvider) - } - } - - if rf, ok := ret.Get(1).(func(bool, string, int) error); ok { - r1 = rf(isPro, countryCode, daysSinceInstalled) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewAdSettings creates a new instance of AdSettings. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewAdSettings(t interface { - mock.TestingT - Cleanup(func()) -}) *AdSettings { - mock := &AdSettings{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internalsdk/mocks/pro_client.go b/internalsdk/mocks/pro_client.go deleted file mode 100644 index 1c29b2185..000000000 --- a/internalsdk/mocks/pro_client.go +++ /dev/null @@ -1,687 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - pro "github.com/getlantern/lantern-client/internalsdk/pro" - mock "github.com/stretchr/testify/mock" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - - protos "github.com/getlantern/lantern-client/internalsdk/protos" -) - -// ProClient is an autogenerated mock type for the ProClient type -type ProClient struct { - mock.Mock -} - -// DeviceAdd provides a mock function with given fields: ctx, deviceName -func (_m *ProClient) DeviceAdd(ctx context.Context, deviceName string) (bool, error) { - ret := _m.Called(ctx, deviceName) - - if len(ret) == 0 { - panic("no return value specified for DeviceAdd") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { - return rf(ctx, deviceName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { - r0 = rf(ctx, deviceName) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, deviceName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeviceRemove provides a mock function with given fields: ctx, deviceId -func (_m *ProClient) DeviceRemove(ctx context.Context, deviceId string) (*pro.LinkResponse, error) { - ret := _m.Called(ctx, deviceId) - - if len(ret) == 0 { - panic("no return value specified for DeviceRemove") - } - - var r0 *pro.LinkResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.LinkResponse, error)); ok { - return rf(ctx, deviceId) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *pro.LinkResponse); ok { - r0 = rf(ctx, deviceId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.LinkResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, deviceId) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EmailExists provides a mock function with given fields: ctx, email -func (_m *ProClient) EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) { - ret := _m.Called(ctx, email) - - if len(ret) == 0 { - panic("no return value specified for EmailExists") - } - - var r0 *protos.BaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { - return rf(ctx, email) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { - r0 = rf(ctx, email) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.BaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, email) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EmailRequest provides a mock function with given fields: ctx, email -func (_m *ProClient) EmailRequest(ctx context.Context, email string) (*pro.OkResponse, error) { - ret := _m.Called(ctx, email) - - if len(ret) == 0 { - panic("no return value specified for EmailRequest") - } - - var r0 *pro.OkResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.OkResponse, error)); ok { - return rf(ctx, email) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *pro.OkResponse); ok { - r0 = rf(ctx, email) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.OkResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, email) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetJSON provides a mock function with given fields: ctx, path, params, target -func (_m *ProClient) GetJSON(ctx context.Context, path string, params any, target any) error { - ret := _m.Called(ctx, path, params, target) - - if len(ret) == 0 { - panic("no return value specified for GetJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { - r0 = rf(ctx, path, params, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetPROTOC provides a mock function with given fields: ctx, path, params, target -func (_m *ProClient) GetPROTOC(ctx context.Context, path string, params any, target protoreflect.ProtoMessage) error { - ret := _m.Called(ctx, path, params, target) - - if len(ret) == 0 { - panic("no return value specified for GetPROTOC") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, protoreflect.ProtoMessage) error); ok { - r0 = rf(ctx, path, params, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// LinkCodeApprove provides a mock function with given fields: ctx, code -func (_m *ProClient) LinkCodeApprove(ctx context.Context, code string) (*protos.BaseResponse, error) { - ret := _m.Called(ctx, code) - - if len(ret) == 0 { - panic("no return value specified for LinkCodeApprove") - } - - var r0 *protos.BaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { - return rf(ctx, code) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { - r0 = rf(ctx, code) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.BaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, code) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LinkCodeRedeem provides a mock function with given fields: ctx, deviceName, deviceCode -func (_m *ProClient) LinkCodeRedeem(ctx context.Context, deviceName string, deviceCode string) (*pro.LinkCodeRedeemResponse, error) { - ret := _m.Called(ctx, deviceName, deviceCode) - - if len(ret) == 0 { - panic("no return value specified for LinkCodeRedeem") - } - - var r0 *pro.LinkCodeRedeemResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pro.LinkCodeRedeemResponse, error)); ok { - return rf(ctx, deviceName, deviceCode) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *pro.LinkCodeRedeemResponse); ok { - r0 = rf(ctx, deviceName, deviceCode) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.LinkCodeRedeemResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, deviceName, deviceCode) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LinkCodeRequest provides a mock function with given fields: ctx, deviceName -func (_m *ProClient) LinkCodeRequest(ctx context.Context, deviceName string) (*pro.LinkCodeResponse, error) { - ret := _m.Called(ctx, deviceName) - - if len(ret) == 0 { - panic("no return value specified for LinkCodeRequest") - } - - var r0 *pro.LinkCodeResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.LinkCodeResponse, error)); ok { - return rf(ctx, deviceName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *pro.LinkCodeResponse); ok { - r0 = rf(ctx, deviceName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.LinkCodeResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, deviceName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PaymentMethods provides a mock function with given fields: ctx -func (_m *ProClient) PaymentMethods(ctx context.Context) (*pro.PaymentMethodsResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for PaymentMethods") - } - - var r0 *pro.PaymentMethodsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*pro.PaymentMethodsResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *pro.PaymentMethodsResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.PaymentMethodsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PaymentMethodsV4 provides a mock function with given fields: ctx -func (_m *ProClient) PaymentMethodsV4(ctx context.Context) (*pro.PaymentMethodsResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for PaymentMethodsV4") - } - - var r0 *pro.PaymentMethodsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*pro.PaymentMethodsResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *pro.PaymentMethodsResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.PaymentMethodsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PaymentRedirect provides a mock function with given fields: ctx, req -func (_m *ProClient) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*pro.PaymentRedirectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for PaymentRedirect") - } - - var r0 *pro.PaymentRedirectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) (*pro.PaymentRedirectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) *pro.PaymentRedirectResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.PaymentRedirectResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *protos.PaymentRedirectRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Plans provides a mock function with given fields: ctx -func (_m *ProClient) Plans(ctx context.Context) (*pro.PlansResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Plans") - } - - var r0 *pro.PlansResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*pro.PlansResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *pro.PlansResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.PlansResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PostFormReadingJSON provides a mock function with given fields: ctx, path, params, target -func (_m *ProClient) PostFormReadingJSON(ctx context.Context, path string, params any, target any) error { - ret := _m.Called(ctx, path, params, target) - - if len(ret) == 0 { - panic("no return value specified for PostFormReadingJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { - r0 = rf(ctx, path, params, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PostJSONReadingJSON provides a mock function with given fields: ctx, path, params, body, target -func (_m *ProClient) PostJSONReadingJSON(ctx context.Context, path string, params any, body any, target any) error { - ret := _m.Called(ctx, path, params, body, target) - - if len(ret) == 0 { - panic("no return value specified for PostJSONReadingJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, any, any) error); ok { - r0 = rf(ctx, path, params, body, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PostPROTOC provides a mock function with given fields: ctx, path, params, body, target -func (_m *ProClient) PostPROTOC(ctx context.Context, path string, params protoreflect.ProtoMessage, body protoreflect.ProtoMessage, target protoreflect.ProtoMessage) error { - ret := _m.Called(ctx, path, params, body, target) - - if len(ret) == 0 { - panic("no return value specified for PostPROTOC") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, protoreflect.ProtoMessage, protoreflect.ProtoMessage, protoreflect.ProtoMessage) error); ok { - r0 = rf(ctx, path, params, body, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PurchaseRequest provides a mock function with given fields: ctx, data -func (_m *ProClient) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*pro.PurchaseResponse, error) { - ret := _m.Called(ctx, data) - - if len(ret) == 0 { - panic("no return value specified for PurchaseRequest") - } - - var r0 *pro.PurchaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*pro.PurchaseResponse, error)); ok { - return rf(ctx, data) - } - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *pro.PurchaseResponse); ok { - r0 = rf(ctx, data) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.PurchaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { - r1 = rf(ctx, data) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RedeemResellerCode provides a mock function with given fields: ctx, req -func (_m *ProClient) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for RedeemResellerCode") - } - - var r0 *protos.BaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) *protos.BaseResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.BaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *protos.RedeemResellerCodeRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReferralAttach provides a mock function with given fields: ctx, refCode -func (_m *ProClient) ReferralAttach(ctx context.Context, refCode string) (bool, error) { - ret := _m.Called(ctx, refCode) - - if len(ret) == 0 { - panic("no return value specified for ReferralAttach") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { - return rf(ctx, refCode) - } - if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { - r0 = rf(ctx, refCode) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, refCode) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RestorePurchase provides a mock function with given fields: ctx, req -func (_m *ProClient) RestorePurchase(ctx context.Context, req map[string]interface{}) (*pro.OkResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for RestorePurchase") - } - - var r0 *pro.OkResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*pro.OkResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *pro.OkResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.OkResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserCreate provides a mock function with given fields: ctx -func (_m *ProClient) UserCreate(ctx context.Context) (*pro.UserDataResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for UserCreate") - } - - var r0 *pro.UserDataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*pro.UserDataResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *pro.UserDataResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.UserDataResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserData provides a mock function with given fields: ctx -func (_m *ProClient) UserData(ctx context.Context) (*pro.UserDataResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for UserData") - } - - var r0 *pro.UserDataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*pro.UserDataResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *pro.UserDataResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.UserDataResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserLinkCodeRequest provides a mock function with given fields: ctx, deviceId, email -func (_m *ProClient) UserLinkCodeRequest(ctx context.Context, deviceId string, email string) (bool, error) { - ret := _m.Called(ctx, deviceId, email) - - if len(ret) == 0 { - panic("no return value specified for UserLinkCodeRequest") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { - return rf(ctx, deviceId, email) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { - r0 = rf(ctx, deviceId, email) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, deviceId, email) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserLinkValidate provides a mock function with given fields: ctx, code -func (_m *ProClient) UserLinkValidate(ctx context.Context, code string) (*pro.UserRecovery, error) { - ret := _m.Called(ctx, code) - - if len(ret) == 0 { - panic("no return value specified for UserLinkValidate") - } - - var r0 *pro.UserRecovery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.UserRecovery, error)); ok { - return rf(ctx, code) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *pro.UserRecovery); ok { - r0 = rf(ctx, code) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pro.UserRecovery) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, code) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewProClient creates a new instance of ProClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewProClient(t interface { - mock.TestingT - Cleanup(func()) -}) *ProClient { - mock := &ProClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index 69ac1e36b..fc88a630a 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -6,6 +6,7 @@ import ( "fmt" "net/http" "strings" + "time" "github.com/getlantern/errors" "github.com/getlantern/flashlight/v7/proxied" @@ -29,8 +30,10 @@ type proClient struct { webclient.RESTClient backoffRunner *backoffRunner userConfig func() common.UserConfig + client ProClient } +//go:generate mockery --name=ProClient --output=../mocks/proclient --with-expecter type ProClient interface { webclient.RESTClient EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) @@ -38,9 +41,9 @@ type ProClient interface { PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) Plans(ctx context.Context) (*PlansResponse, error) - PollUserData(ctx context.Context, session ClientSession, onUserData func(*protos.User)) + PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) - RetryCreateUser(ctx context.Context, session ClientSession) + RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) UserCreate(ctx context.Context) (*UserDataResponse, error) UserData(ctx context.Context) (*UserDataResponse, error) UpdateUserData(ctx context.Context, ss ClientSession) (*protos.User, error) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index 472207e53..a88b69e1d 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -2,7 +2,6 @@ package pro import ( "context" - "fmt" "sync" "time" @@ -11,13 +10,18 @@ import ( "github.com/getlantern/lantern-client/internalsdk/protos" ) -// ClientSession includes information needed to createa new client session -type ClientSession interface { +// UserConfig represents the minimal configuration necessary for a client session +type UserConfig interface { GetDeviceID() string GetUserFirstVisit() bool GetUserID() int64 GetToken() string - //Locale() string + Locale() string +} + +// ClientSession represents a client session +type ClientSession interface { + UserConfig SetExpiration(int64) SetProUser(bool) SetReferralCode(string) @@ -46,12 +50,12 @@ func (c *proClient) createUser(ctx context.Context, session ClientSession) error } // RetryCreateUser is used to retry creating a user with an exponential backoff strategy -func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession) { +func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) { expBackoff := backoff.NewExponentialBackOff() expBackoff.Multiplier = 2.0 expBackoff.InitialInterval = 3 * time.Second expBackoff.MaxInterval = 1 * time.Minute - expBackoff.MaxElapsedTime = 10 * time.Minute + expBackoff.MaxElapsedTime = maxElapsedTime expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval err := backoff.Retry(func() error { return c.createUser(ctx, ss) @@ -102,7 +106,8 @@ func (c *proClient) UpdateUserData(ctx context.Context, ss ClientSession) (*prot } // RetryCreateUser is used to retry creating a user with an exponential backoff strategy -func (c *proClient) PollUserData(ctx context.Context, session ClientSession, onUserData func(*protos.User)) { +func (c *proClient) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration) { + log.Debug("Polling user data") b := c.backoffRunner b.mu.Lock() if b.isRunning { @@ -112,7 +117,9 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, onU b.isRunning = true b.mu.Unlock() + ctx, cancel := context.WithTimeout(ctx, maxElapsedTime) defer func() { + cancel() b.mu.Lock() b.isRunning = false b.mu.Unlock() @@ -122,33 +129,39 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, onU expBackoff.Multiplier = 2.0 expBackoff.InitialInterval = 10 * time.Second expBackoff.MaxInterval = 2 * time.Minute - expBackoff.MaxElapsedTime = 10 * time.Minute - expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval - timer := time.NewTimer(0) // Start immediately + expBackoff.MaxElapsedTime = maxElapsedTime + // Add jitter to backoff interval + expBackoff.RandomizationFactor = 0.5 + + if _, err := c.UpdateUserData(ctx, session); err != nil { + log.Errorf("Initial user data update failed: %v", err) + } + + timer := time.NewTimer(expBackoff.NextBackOff()) defer timer.Stop() for { select { case <-ctx.Done(): - fmt.Println("Task cancelled:", ctx.Err()) + log.Errorf("Poll user data cancelled: %v", ctx.Err()) return case <-timer.C: - // Wait for the timer to expire - user, err := c.UpdateUserData(ctx, session) + _, err := c.UpdateUserData(ctx, session) if err != nil { - log.Error(err) - } else if onUserData != nil { - onUserData(user) + if ctx.Err() != nil { + log.Errorf("UpdateUserData terminated due to context: %v", ctx.Err()) + return + } + log.Errorf("UpdateUserData failed: %v", err) } // Get the next backoff interval waitTime := expBackoff.NextBackOff() if waitTime == backoff.Stop { - expBackoff.Reset() - waitTime = expBackoff.NextBackOff() + log.Debug("Exponential backoff reached max elapsed time. Exiting...") + timer.Stop() + return } - fmt.Printf("Next attempt in %v...\n", waitTime) - // Reset the timer with the next backoff interval timer.Reset(waitTime) } } diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go index 64c8c24a6..164b100af 100644 --- a/internalsdk/pro/user_test.go +++ b/internalsdk/pro/user_test.go @@ -5,40 +5,46 @@ import ( "testing" "github.com/getlantern/errors" - "github.com/getlantern/lantern-client/internalsdk/mocks" "github.com/getlantern/lantern-client/internalsdk/protos" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) func TestCreateUser_Success(t *testing.T) { - - mockProClient := new(mocks.ProClient) - mockSession := new(mocks.Session) + mockClient := new(MockProClient) + mockSession := new(MockClientSession) // Set up expected behavior - mockProClient.On("UserCreate", mock.Anything).Return(&UserDataResponse{ + mockClient.On("UserCreate", mock.Anything).Return(&UserDataResponse{ User: &protos.User{ UserId: 123, Token: "test-token", }, }, nil) - mockSession.On("SetUserIdAndToken", int64(123), "test-token").Return(nil) + mockClient.On("SetUserIdAndToken", int64(123), "test-token").Return(nil) - err := createUser(context.Background(), mockProClient, mockSession) + _, err := mockClient.UserCreate(context.Background()) assert.NoError(t, err, "expected no error") // Verify that UserCreate and SetUserIdAndToken were called once - mockProClient.AssertCalled(t, "UserCreate", mock.Anything) + mockClient.AssertCalled(t, "UserCreate", mock.Anything) mockSession.AssertCalled(t, "SetUserIdAndToken", int64(123), "test-token") } func TestCreateUser_Failure(t *testing.T) { - mockProClient := new(mocks.ProClient) - mockSession := new(mocks.Session) + mockClient := new(MockProClient) - mockProClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) + mockClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) - err := createUser(context.Background(), mockProClient, mockSession) + _, err := mockClient.UserCreate(context.Background()) assert.Error(t, err, "expected an error") - mockProClient.AssertCalled(t, "UserCreate", mock.Anything) + mockClient.AssertCalled(t, "UserCreate", mock.Anything) +} + +type mockClient struct { + mock.Mock +} + +func (m *mockClient) UpdateUserData(ctx context.Context, session ClientSession) (interface{}, error) { + args := m.Called(ctx, session) + return args.Get(0), args.Error(1) } diff --git a/internalsdk/session_model.go b/internalsdk/session_model.go index 45ef05591..05c27dd83 100644 --- a/internalsdk/session_model.go +++ b/internalsdk/session_model.go @@ -246,7 +246,7 @@ func (m *SessionModel) doInvokeMethod(method string, arguments Arguments) (inter } return true, nil case "setProUser": - err := setProUser(m.baseModel, arguments.Scalar().Bool()) + err := m.SetProUser(arguments.Scalar().Bool()) if err != nil { return nil, err } @@ -329,7 +329,7 @@ func (m *SessionModel) doInvokeMethod(method string, arguments Arguments) (inter case "setUserIdAndToken": userId := arguments.Get("userId").Int() token := arguments.Get("token").String() - err := m.SetUserIdAndToken(int64(userId), token) + err := m.SetUserIDAndToken(int64(userId), token) if err != nil { return nil, err } @@ -968,7 +968,7 @@ func setUserLevel(m *baseModel, userLevel string) error { return pathdb.Put(tx, pathUserLevel, userLevel, "") }) } -func setExpiration(m *baseModel, expiration int64) error { +func (m *SessionModel) SetExpiration(expiration int64) error { if expiration == 0 { return nil } @@ -1219,12 +1219,18 @@ func (m *SessionModel) IsProUser() (bool, error) { return pathdb.Get[bool](m.db, pathProUser) } -func setProUser(m *baseModel, isPro bool) error { +func (m *SessionModel) SetProUser(isPro bool) error { return pathdb.Mutate(m.db, func(tx pathdb.TX) error { return pathdb.Put(tx, pathProUser, isPro, "") }) } +func (m *SessionModel) SetReferralCode(referralCode string) error { + return pathdb.Mutate(m.db, func(tx pathdb.TX) error { + return pathdb.Put(tx, pathReferralCode, referralCode, "") + }) +} + func (m *SessionModel) SetReplicaAddr(replicaAddr string) { log.Debugf("Setting replica address %v", replicaAddr) panicIfNecessary(pathdb.Mutate(m.db, func(tx pathdb.TX) error { @@ -1321,6 +1327,10 @@ func (session *SessionModel) updateVpnPref(prefVPN bool) error { }) } +func (m *SessionModel) GetUserFirstVisit() (bool, error) { + return pathdb.Get[bool](m.db, pathIsFirstTime) +} + func checkFirstTimeVisit(m *baseModel) (bool, error) { firsttime, err := pathdb.Get[bool](m.db, pathIsFirstTime) if err != nil { @@ -1339,7 +1349,7 @@ func isShowFirstTimeUserVisit(m *baseModel) error { // Keep name as p1,p2 somehow is conflicting with objective c // p1 is userid and p2 is token -func (m *SessionModel) SetUserIdAndToken(p1 int64, p2 string) error { +func (m *SessionModel) SetUserIDAndToken(p1 int64, p2 string) error { log.Debugf("Setting user id %v token %v", p1, p2) return pathdb.Mutate(m.db, func(tx pathdb.TX) error { if err := pathdb.Put[int64](tx, pathUserID, p1, ""); err != nil { @@ -1393,7 +1403,7 @@ func (session *SessionModel) userCreate(ctx context.Context) error { } //Save user id and token - err = session.SetUserIdAndToken(int64(user.UserId), user.Token) + err = session.SetUserIDAndToken(int64(user.UserId), user.Token) if err != nil { return err } @@ -1419,10 +1429,10 @@ func (session *SessionModel) userDetail(ctx context.Context) error { if logged { userDetail.Email = "" } - return cacheUserDetail(session, userDetail) + return session.cacheUserDetail(userDetail) } -func cacheUserDetail(session *SessionModel, userDetail *protos.User) error { +func (session *SessionModel) cacheUserDetail(userDetail *protos.User) error { if userDetail.Email != "" { setEmail(session.baseModel, userDetail.Email) } @@ -1439,7 +1449,7 @@ func cacheUserDetail(session *SessionModel, userDetail *protos.User) error { return err } - err = setExpiration(session.baseModel, userDetail.Expiration) + err = session.SetExpiration(userDetail.Expiration) if err != nil { return err } @@ -1469,15 +1479,15 @@ func cacheUserDetail(session *SessionModel, userDetail *protos.User) error { log.Debugf("First time visit %v", firstTime) if userDetail.UserLevel == "pro" && firstTime { log.Debugf("User is pro and first time") - setProUser(session.baseModel, true) + session.SetProUser(true) } else if userDetail.UserLevel == "pro" && !firstTime && deviceFound { log.Debugf("User is pro and not first time") - setProUser(session.baseModel, true) + session.SetProUser(true) } else if userDetail.UserLevel == "pro" { log.Debugf("user is pro and device not found") - setProUser(session.baseModel, true) + session.SetProUser(true) } else { - setProUser(session.baseModel, false) + session.SetProUser(false) } //Store all device @@ -1486,7 +1496,7 @@ func cacheUserDetail(session *SessionModel, userDetail *protos.User) error { return err } log.Debugf("User caching successful: %+v", userDetail) - return session.SetUserIdAndToken(int64(userDetail.UserId), userDetail.Token) + return session.SetUserIDAndToken(int64(userDetail.UserId), userDetail.Token) } func reportIssue(session *SessionModel, email string, issue string, description string) error { @@ -1587,7 +1597,7 @@ func redeemResellerCode(m *SessionModel, email string, resellerCode string) erro log.Debugf("Purchase Request response %v", purchase) // Set user to pro - return setProUser(m.baseModel, true) + return m.SetProUser(true) } // Payment Methods @@ -1610,7 +1620,7 @@ func submitApplePayPayment(m *SessionModel, email string, planId string, purchas return errors.New("Purchase Request failed") } // Set user to pro - return setProUser(m.baseModel, true) + return m.SetProUser(true) } func restorePurchase(session *SessionModel, email string, code string, provider string) error { @@ -1632,7 +1642,7 @@ func restorePurchase(session *SessionModel, email string, code string, provider if okResponse.Status != "ok" { return errors.New("error restoring purchase") } - setProUser(session.baseModel, true) + session.SetProUser(true) return nil } @@ -1654,7 +1664,7 @@ func submitGooglePlayPayment(m *SessionModel, email string, planId string, purch log.Debugf("Purchase response %v", purchase) // Set user to pro - return setProUser(m.baseModel, true) + return m.SetProUser(true) } func submitStripePlayPayment(m *SessionModel, email string, planId string, purchaseToken string) error { @@ -1675,7 +1685,7 @@ func submitStripePlayPayment(m *SessionModel, email string, planId string, purch } log.Debugf("Purchase response %v", purchase) // Set user to pro - return setProUser(m.baseModel, true) + return m.SetProUser(true) } func (session *SessionModel) applyRefCode(refCode string) error { @@ -1715,7 +1725,7 @@ func testProviderRequest(session *SessionModel, email string, paymentProvider st if err != nil { return err } - return setProUser(session.baseModel, true) + return session.SetProUser(true) } /// Auth APIS @@ -1819,7 +1829,7 @@ func login(session *SessionModel, email string, password string) error { // once login is successfull save user details // but overide there email with login email userData.Email = email - err = cacheUserDetail(session, userData) + err = session.cacheUserDetail(userData) if err != nil { log.Errorf("Error while caching user details %v", err) return err @@ -1867,7 +1877,7 @@ func deviceLimitFlow(session *SessionModel, login *protos.LoginResponse) error { if err != nil { return err } - return session.SetUserIdAndToken(login.LegacyID, login.LegacyToken) + return session.SetUserIDAndToken(login.LegacyID, login.LegacyToken) } func startRecoveryByEmail(session *SessionModel, email string) error { @@ -2243,7 +2253,7 @@ func linkCodeRedeem(session *SessionModel) error { return err } log.Debugf("linkCodeRedeem response %+v", linkRedeemResponse) - err = session.SetUserIdAndToken(linkRedeemResponse.UserID, linkRedeemResponse.Token) + err = session.SetUserIDAndToken(linkRedeemResponse.UserID, linkRedeemResponse.Token) if err != nil { return log.Errorf("Error while setting user id and token %v", err) } @@ -2314,7 +2324,7 @@ func validateDeviceRecoveryCode(session *SessionModel, code string) error { return err } log.Debugf("ValidateRecovery code response %v", linkResponse) - err = session.SetUserIdAndToken(linkResponse.UserID, linkResponse.Token) + err = session.SetUserIDAndToken(linkResponse.UserID, linkResponse.Token) if err != nil { return err } diff --git a/internalsdk/user_test.go b/internalsdk/user_test.go deleted file mode 100644 index 720344db1..000000000 --- a/internalsdk/user_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package internalsdk - -import ( - "context" - "testing" - - "github.com/getlantern/errors" - "github.com/getlantern/lantern-client/internalsdk/mocks" - "github.com/getlantern/lantern-client/internalsdk/pro" - "github.com/getlantern/lantern-client/internalsdk/protos" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" -) - -func TestCreateUser_Success(t *testing.T) { - - mockProClient := new(mocks.ProClient) - mockSession := new(mocks.Session) - - // Set up expected behavior - mockProClient.On("UserCreate", mock.Anything).Return(&pro.UserDataResponse{ - User: &protos.User{ - UserId: 123, - Token: "test-token", - }, - }, nil) - mockSession.On("SetUserIdAndToken", int64(123), "test-token").Return(nil) - - err := createUser(context.Background(), mockProClient, mockSession) - assert.NoError(t, err, "expected no error") - // Verify that UserCreate and SetUserIdAndToken were called once - mockProClient.AssertCalled(t, "UserCreate", mock.Anything) - mockSession.AssertCalled(t, "SetUserIdAndToken", int64(123), "test-token") -} - -func TestCreateUser_Failure(t *testing.T) { - mockProClient := new(mocks.ProClient) - mockSession := new(mocks.Session) - - mockProClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) - - err := createUser(context.Background(), mockProClient, mockSession) - assert.Error(t, err, "expected an error") - mockProClient.AssertCalled(t, "UserCreate", mock.Anything) -} diff --git a/internalsdk/utils.go b/internalsdk/utils.go index 20cb586dc..3c6c254d7 100644 --- a/internalsdk/utils.go +++ b/internalsdk/utils.go @@ -26,7 +26,7 @@ import ( ) // createProClient creates a new instance of ProClient with the given client session information -func createProClient(session ClientSession, platform string) pro.ProClient { +func createProClient(session Session, platform string) pro.ProClient { dialTimeout := 30 * time.Second if platform == "ios" { dialTimeout = 20 * time.Second From 051dbc4bf56ea2a0a27a0f545e0ef9c4e2edd9b4 Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 20:48:33 -0800 Subject: [PATCH 06/23] Update desktop to use same code to retry creating user --- internalsdk/pro/mockclientsession.go | 134 +++++ internalsdk/pro/mockproclient.go | 728 +++++++++++++++++++++++++++ 2 files changed, 862 insertions(+) create mode 100644 internalsdk/pro/mockclientsession.go create mode 100644 internalsdk/pro/mockproclient.go diff --git a/internalsdk/pro/mockclientsession.go b/internalsdk/pro/mockclientsession.go new file mode 100644 index 000000000..2ff5fc760 --- /dev/null +++ b/internalsdk/pro/mockclientsession.go @@ -0,0 +1,134 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package pro + +import mock "github.com/stretchr/testify/mock" + +// MockClientSession is an autogenerated mock type for the ClientSession type +type MockClientSession struct { + mock.Mock +} + +// GetDeviceID provides a mock function with given fields: +func (_m *MockClientSession) GetDeviceID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDeviceID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetToken provides a mock function with given fields: +func (_m *MockClientSession) GetToken() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetToken") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetUserFirstVisit provides a mock function with given fields: +func (_m *MockClientSession) GetUserFirstVisit() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUserFirstVisit") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// GetUserID provides a mock function with given fields: +func (_m *MockClientSession) GetUserID() int64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUserID") + } + + var r0 int64 + if rf, ok := ret.Get(0).(func() int64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int64) + } + + return r0 +} + +// Locale provides a mock function with given fields: +func (_m *MockClientSession) Locale() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Locale") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// SetExpiration provides a mock function with given fields: _a0 +func (_m *MockClientSession) SetExpiration(_a0 int64) { + _m.Called(_a0) +} + +// SetProUser provides a mock function with given fields: _a0 +func (_m *MockClientSession) SetProUser(_a0 bool) { + _m.Called(_a0) +} + +// SetReferralCode provides a mock function with given fields: _a0 +func (_m *MockClientSession) SetReferralCode(_a0 string) { + _m.Called(_a0) +} + +// SetUserIDAndToken provides a mock function with given fields: _a0, _a1 +func (_m *MockClientSession) SetUserIDAndToken(_a0 int64, _a1 string) { + _m.Called(_a0, _a1) +} + +// NewMockClientSession creates a new instance of MockClientSession. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockClientSession(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClientSession { + mock := &MockClientSession{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internalsdk/pro/mockproclient.go b/internalsdk/pro/mockproclient.go new file mode 100644 index 000000000..d313e2cbe --- /dev/null +++ b/internalsdk/pro/mockproclient.go @@ -0,0 +1,728 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package pro + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + + protos "github.com/getlantern/lantern-client/internalsdk/protos" + + time "time" +) + +// MockProClient is an autogenerated mock type for the ProClient type +type MockProClient struct { + mock.Mock +} + +// DeviceAdd provides a mock function with given fields: ctx, deviceName +func (_m *MockProClient) DeviceAdd(ctx context.Context, deviceName string) (bool, error) { + ret := _m.Called(ctx, deviceName) + + if len(ret) == 0 { + panic("no return value specified for DeviceAdd") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, deviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, deviceName) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, deviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeviceRemove provides a mock function with given fields: ctx, deviceId +func (_m *MockProClient) DeviceRemove(ctx context.Context, deviceId string) (*LinkResponse, error) { + ret := _m.Called(ctx, deviceId) + + if len(ret) == 0 { + panic("no return value specified for DeviceRemove") + } + + var r0 *LinkResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*LinkResponse, error)); ok { + return rf(ctx, deviceId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *LinkResponse); ok { + r0 = rf(ctx, deviceId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*LinkResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, deviceId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EmailExists provides a mock function with given fields: ctx, email +func (_m *MockProClient) EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) { + ret := _m.Called(ctx, email) + + if len(ret) == 0 { + panic("no return value specified for EmailExists") + } + + var r0 *protos.BaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { + return rf(ctx, email) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { + r0 = rf(ctx, email) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.BaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, email) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EmailRequest provides a mock function with given fields: ctx, email +func (_m *MockProClient) EmailRequest(ctx context.Context, email string) (*OkResponse, error) { + ret := _m.Called(ctx, email) + + if len(ret) == 0 { + panic("no return value specified for EmailRequest") + } + + var r0 *OkResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*OkResponse, error)); ok { + return rf(ctx, email) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *OkResponse); ok { + r0 = rf(ctx, email) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*OkResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, email) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetJSON provides a mock function with given fields: ctx, path, params, target +func (_m *MockProClient) GetJSON(ctx context.Context, path string, params any, target any) error { + ret := _m.Called(ctx, path, params, target) + + if len(ret) == 0 { + panic("no return value specified for GetJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { + r0 = rf(ctx, path, params, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GetPROTOC provides a mock function with given fields: ctx, path, params, target +func (_m *MockProClient) GetPROTOC(ctx context.Context, path string, params any, target protoreflect.ProtoMessage) error { + ret := _m.Called(ctx, path, params, target) + + if len(ret) == 0 { + panic("no return value specified for GetPROTOC") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, protoreflect.ProtoMessage) error); ok { + r0 = rf(ctx, path, params, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// LinkCodeApprove provides a mock function with given fields: ctx, code +func (_m *MockProClient) LinkCodeApprove(ctx context.Context, code string) (*protos.BaseResponse, error) { + ret := _m.Called(ctx, code) + + if len(ret) == 0 { + panic("no return value specified for LinkCodeApprove") + } + + var r0 *protos.BaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { + return rf(ctx, code) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { + r0 = rf(ctx, code) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.BaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, code) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkCodeRedeem provides a mock function with given fields: ctx, deviceName, deviceCode +func (_m *MockProClient) LinkCodeRedeem(ctx context.Context, deviceName string, deviceCode string) (*LinkCodeRedeemResponse, error) { + ret := _m.Called(ctx, deviceName, deviceCode) + + if len(ret) == 0 { + panic("no return value specified for LinkCodeRedeem") + } + + var r0 *LinkCodeRedeemResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*LinkCodeRedeemResponse, error)); ok { + return rf(ctx, deviceName, deviceCode) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *LinkCodeRedeemResponse); ok { + r0 = rf(ctx, deviceName, deviceCode) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*LinkCodeRedeemResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, deviceName, deviceCode) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkCodeRequest provides a mock function with given fields: ctx, deviceName +func (_m *MockProClient) LinkCodeRequest(ctx context.Context, deviceName string) (*LinkCodeResponse, error) { + ret := _m.Called(ctx, deviceName) + + if len(ret) == 0 { + panic("no return value specified for LinkCodeRequest") + } + + var r0 *LinkCodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*LinkCodeResponse, error)); ok { + return rf(ctx, deviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *LinkCodeResponse); ok { + r0 = rf(ctx, deviceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*LinkCodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, deviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PaymentMethods provides a mock function with given fields: ctx +func (_m *MockProClient) PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for PaymentMethods") + } + + var r0 *PaymentMethodsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*PaymentMethodsResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *PaymentMethodsResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*PaymentMethodsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PaymentMethodsV4 provides a mock function with given fields: ctx +func (_m *MockProClient) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for PaymentMethodsV4") + } + + var r0 *PaymentMethodsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*PaymentMethodsResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *PaymentMethodsResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*PaymentMethodsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PaymentRedirect provides a mock function with given fields: ctx, req +func (_m *MockProClient) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for PaymentRedirect") + } + + var r0 *PaymentRedirectResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) *PaymentRedirectResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*PaymentRedirectResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *protos.PaymentRedirectRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Plans provides a mock function with given fields: ctx +func (_m *MockProClient) Plans(ctx context.Context) (*PlansResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Plans") + } + + var r0 *PlansResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*PlansResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *PlansResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*PlansResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PollUserData provides a mock function with given fields: ctx, session, maxElapsedTime +func (_m *MockProClient) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration) { + _m.Called(ctx, session, maxElapsedTime) +} + +// PostFormReadingJSON provides a mock function with given fields: ctx, path, params, target +func (_m *MockProClient) PostFormReadingJSON(ctx context.Context, path string, params any, target any) error { + ret := _m.Called(ctx, path, params, target) + + if len(ret) == 0 { + panic("no return value specified for PostFormReadingJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { + r0 = rf(ctx, path, params, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PostJSONReadingJSON provides a mock function with given fields: ctx, path, params, body, target +func (_m *MockProClient) PostJSONReadingJSON(ctx context.Context, path string, params any, body any, target any) error { + ret := _m.Called(ctx, path, params, body, target) + + if len(ret) == 0 { + panic("no return value specified for PostJSONReadingJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, any, any) error); ok { + r0 = rf(ctx, path, params, body, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PostPROTOC provides a mock function with given fields: ctx, path, params, body, target +func (_m *MockProClient) PostPROTOC(ctx context.Context, path string, params protoreflect.ProtoMessage, body protoreflect.ProtoMessage, target protoreflect.ProtoMessage) error { + ret := _m.Called(ctx, path, params, body, target) + + if len(ret) == 0 { + panic("no return value specified for PostPROTOC") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, protoreflect.ProtoMessage, protoreflect.ProtoMessage, protoreflect.ProtoMessage) error); ok { + r0 = rf(ctx, path, params, body, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PurchaseRequest provides a mock function with given fields: ctx, data +func (_m *MockProClient) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) { + ret := _m.Called(ctx, data) + + if len(ret) == 0 { + panic("no return value specified for PurchaseRequest") + } + + var r0 *PurchaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*PurchaseResponse, error)); ok { + return rf(ctx, data) + } + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *PurchaseResponse); ok { + r0 = rf(ctx, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*PurchaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { + r1 = rf(ctx, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RedeemResellerCode provides a mock function with given fields: ctx, req +func (_m *MockProClient) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for RedeemResellerCode") + } + + var r0 *protos.BaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) *protos.BaseResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.BaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *protos.RedeemResellerCodeRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReferralAttach provides a mock function with given fields: ctx, refCode +func (_m *MockProClient) ReferralAttach(ctx context.Context, refCode string) (bool, error) { + ret := _m.Called(ctx, refCode) + + if len(ret) == 0 { + panic("no return value specified for ReferralAttach") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, refCode) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, refCode) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, refCode) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RestorePurchase provides a mock function with given fields: ctx, req +func (_m *MockProClient) RestorePurchase(ctx context.Context, req map[string]interface{}) (*OkResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for RestorePurchase") + } + + var r0 *OkResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*OkResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *OkResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*OkResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RetryCreateUser provides a mock function with given fields: ctx, ss, maxElapsedTime +func (_m *MockProClient) RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) { + _m.Called(ctx, ss, maxElapsedTime) +} + +// UpdateUserData provides a mock function with given fields: ctx, ss +func (_m *MockProClient) UpdateUserData(ctx context.Context, ss ClientSession) (*protos.User, error) { + ret := _m.Called(ctx, ss) + + if len(ret) == 0 { + panic("no return value specified for UpdateUserData") + } + + var r0 *protos.User + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ClientSession) (*protos.User, error)); ok { + return rf(ctx, ss) + } + if rf, ok := ret.Get(0).(func(context.Context, ClientSession) *protos.User); ok { + r0 = rf(ctx, ss) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.User) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ClientSession) error); ok { + r1 = rf(ctx, ss) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UserCreate provides a mock function with given fields: ctx +func (_m *MockProClient) UserCreate(ctx context.Context) (*UserDataResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for UserCreate") + } + + var r0 *UserDataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*UserDataResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *UserDataResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*UserDataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UserData provides a mock function with given fields: ctx +func (_m *MockProClient) UserData(ctx context.Context) (*UserDataResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for UserData") + } + + var r0 *UserDataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*UserDataResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *UserDataResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*UserDataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UserLinkCodeRequest provides a mock function with given fields: ctx, deviceId, email +func (_m *MockProClient) UserLinkCodeRequest(ctx context.Context, deviceId string, email string) (bool, error) { + ret := _m.Called(ctx, deviceId, email) + + if len(ret) == 0 { + panic("no return value specified for UserLinkCodeRequest") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { + return rf(ctx, deviceId, email) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, deviceId, email) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, deviceId, email) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UserLinkValidate provides a mock function with given fields: ctx, code +func (_m *MockProClient) UserLinkValidate(ctx context.Context, code string) (*UserRecovery, error) { + ret := _m.Called(ctx, code) + + if len(ret) == 0 { + panic("no return value specified for UserLinkValidate") + } + + var r0 *UserRecovery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*UserRecovery, error)); ok { + return rf(ctx, code) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *UserRecovery); ok { + r0 = rf(ctx, code) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*UserRecovery) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, code) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewMockProClient creates a new instance of MockProClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProClient { + mock := &MockProClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} From dc5bed5bb35a02843566310e349f8cc302699c6e Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 21:32:43 -0800 Subject: [PATCH 07/23] revert changes --- Makefile | 6 +- .../org.eclipse.buildship.core.prefs | 4 +- desktop/lib.go | 5 +- internalsdk/mocks/Session.go | 717 ++++++++ internalsdk/mocks/ad_provider.go | 96 ++ internalsdk/mocks/ad_settings.go | 56 + internalsdk/mocks/pro_client.go | 1531 +++++++++++++++++ internalsdk/pro/mockclientsession.go | 134 -- internalsdk/pro/mockproclient.go | 728 -------- internalsdk/pro/pro.go | 10 +- internalsdk/pro/user.go | 7 +- internalsdk/pro/user_test.go | 99 +- 12 files changed, 2487 insertions(+), 906 deletions(-) create mode 100644 internalsdk/mocks/Session.go create mode 100644 internalsdk/mocks/ad_provider.go create mode 100644 internalsdk/mocks/ad_settings.go create mode 100644 internalsdk/mocks/pro_client.go delete mode 100644 internalsdk/pro/mockclientsession.go delete mode 100644 internalsdk/pro/mockproclient.go diff --git a/Makefile b/Makefile index 72f807acf..ead8c18f2 100644 --- a/Makefile +++ b/Makefile @@ -462,14 +462,12 @@ ios-release: set-version guard-SENTRY_AUTH_TOKEN guard-SENTRY_ORG guard-SENTRY_P ## Mocks MOCKERY=mockery -MOCKERY_FLAGS=--case=underscore --output=./internalsdk/mocks --outpkg=mocks --with-expecter +MOCKERY_FLAGS=--case=underscore --output=internalsdk/mocks --outpkg=mocks .PHONY: mocks mocks: @$(MOCKERY) --name=AdProvider --name=AdSettings --name=Session --dir=./internalsdk $(MOCKERY_FLAGS) - @$(MOCKERY) --name=ProClient --dir=./internalsdk/pro --outpkg=pro --output=./internalsdk/pro --structname=MockProClient - @$(MOCKERY) --name=ClientSession --dir=./internalsdk/pro --outpkg=pro --output=./internalsdk/pro $(MOCKERY_FLAGS) - + @$(MOCKERY) --name=ProClient --dir=./internalsdk/pro $(MOCKERY_FLAGS) .PHONY: echo-build-tags echo-build-tags: ## Prints build tags and extra ldflags. Run this with `REPLICA=1 make echo-build-tags` for example to see how it changes diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs index 33c657ef4..c3298654d 100644 --- a/android/.settings/org.eclipse.buildship.core.prefs +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -1,11 +1,11 @@ -arguments=--init-script /var/folders/j5/yrnkkcxx6wlcr7h2f574qfjc0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/j5/yrnkkcxx6wlcr7h2f574qfjc0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle +arguments= auto.sync=false build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home=/opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home +java.home=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home jvm.arguments= offline.mode=false override.workspace.settings=true diff --git a/desktop/lib.go b/desktop/lib.go index 2473a405a..e01fbf7c6 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -149,7 +149,8 @@ func setProxyAll(value *C.char) { //export hasPlanUpdatedOrBuy func hasPlanUpdatedOrBuy() *C.char { ctx := context.Background() - go a.ProClient().PollUserData(ctx, a.Settings(), 10*time.Minute) + proClient := a.ProClient() + go proClient.PollUserData(ctx, a.Settings(), 10*time.Minute, proClient) //Get the cached user data log.Debugf("DEBUG: Checking if user has updated plan or bought new plan") cacheUserData, isOldFound := cachedUserData() @@ -167,7 +168,7 @@ func hasPlanUpdatedOrBuy() *C.char { return C.CString(string("true")) } } - return C.CString(string("true")) + return C.CString(string("false")) } //export applyRef diff --git a/internalsdk/mocks/Session.go b/internalsdk/mocks/Session.go new file mode 100644 index 000000000..c7b031605 --- /dev/null +++ b/internalsdk/mocks/Session.go @@ -0,0 +1,717 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// Session is an autogenerated mock type for the Session type +type Session struct { + mock.Mock +} + +// BandwidthUpdate provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *Session) BandwidthUpdate(_a0 int, _a1 int, _a2 int, _a3 int) error { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for BandwidthUpdate") + } + + var r0 error + if rf, ok := ret.Get(0).(func(int, int, int, int) error); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ChatEnable provides a mock function with given fields: +func (_m *Session) ChatEnable() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ChatEnable") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Code provides a mock function with given fields: +func (_m *Session) Code() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Code") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Currency provides a mock function with given fields: +func (_m *Session) Currency() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Currency") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeviceOS provides a mock function with given fields: +func (_m *Session) DeviceOS() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DeviceOS") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Email provides a mock function with given fields: +func (_m *Session) Email() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Email") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ForceReplica provides a mock function with given fields: +func (_m *Session) ForceReplica() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ForceReplica") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// GetAppName provides a mock function with given fields: +func (_m *Session) GetAppName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAppName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetCountryCode provides a mock function with given fields: +func (_m *Session) GetCountryCode() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetCountryCode") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetDNSServer provides a mock function with given fields: +func (_m *Session) GetDNSServer() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDNSServer") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetDeviceID provides a mock function with given fields: +func (_m *Session) GetDeviceID() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDeviceID") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetForcedCountryCode provides a mock function with given fields: +func (_m *Session) GetForcedCountryCode() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetForcedCountryCode") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetTimeZone provides a mock function with given fields: +func (_m *Session) GetTimeZone() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTimeZone") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetToken provides a mock function with given fields: +func (_m *Session) GetToken() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetToken") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetUserID provides a mock function with given fields: +func (_m *Session) GetUserID() (int64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUserID") + } + + var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() int64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IsProUser provides a mock function with given fields: +func (_m *Session) IsProUser() (bool, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsProUser") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func() (bool, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IsStoreVersion provides a mock function with given fields: +func (_m *Session) IsStoreVersion() (bool, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsStoreVersion") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func() (bool, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Locale provides a mock function with given fields: +func (_m *Session) Locale() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Locale") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Provider provides a mock function with given fields: +func (_m *Session) Provider() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Provider") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SerializedInternalHeaders provides a mock function with given fields: +func (_m *Session) SerializedInternalHeaders() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SerializedInternalHeaders") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetAuthEnabled provides a mock function with given fields: _a0 +func (_m *Session) SetAuthEnabled(_a0 bool) { + _m.Called(_a0) +} + +// SetChatEnabled provides a mock function with given fields: _a0 +func (_m *Session) SetChatEnabled(_a0 bool) { + _m.Called(_a0) +} + +// SetCountry provides a mock function with given fields: _a0 +func (_m *Session) SetCountry(_a0 string) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetCountry") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SetHasConfigFetched provides a mock function with given fields: _a0 +func (_m *Session) SetHasConfigFetched(_a0 bool) { + _m.Called(_a0) +} + +// SetHasProxyFetched provides a mock function with given fields: _a0 +func (_m *Session) SetHasProxyFetched(_a0 bool) { + _m.Called(_a0) +} + +// SetIP provides a mock function with given fields: _a0 +func (_m *Session) SetIP(_a0 string) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetIP") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SetOnSuccess provides a mock function with given fields: _a0 +func (_m *Session) SetOnSuccess(_a0 bool) { + _m.Called(_a0) +} + +// SetReplicaAddr provides a mock function with given fields: _a0 +func (_m *Session) SetReplicaAddr(_a0 string) { + _m.Called(_a0) +} + +// SetShowGoogleAds provides a mock function with given fields: _a0 +func (_m *Session) SetShowGoogleAds(_a0 bool) { + _m.Called(_a0) +} + +// SetStaging provides a mock function with given fields: _a0 +func (_m *Session) SetStaging(_a0 bool) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetStaging") + } + + var r0 error + if rf, ok := ret.Get(0).(func(bool) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SetUserIdAndToken provides a mock function with given fields: _a0, _a1 +func (_m *Session) SetUserIdAndToken(_a0 int64, _a1 string) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for SetUserIdAndToken") + } + + var r0 error + if rf, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SplitTunnelingEnabled provides a mock function with given fields: +func (_m *Session) SplitTunnelingEnabled() (bool, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SplitTunnelingEnabled") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func() (bool, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UpdateAdSettings provides a mock function with given fields: _a0 +func (_m *Session) UpdateAdSettings(_a0 AdSettings) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for UpdateAdSettings") + } + + var r0 error + if rf, ok := ret.Get(0).(func(AdSettings) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// UpdateStats provides a mock function with given fields: serverCity, serverCountry, serverCountryCode, p3, p4, hasSucceedingProxy +func (_m *Session) UpdateStats(serverCity string, serverCountry string, serverCountryCode string, p3 int, p4 int, hasSucceedingProxy bool) error { + ret := _m.Called(serverCity, serverCountry, serverCountryCode, p3, p4, hasSucceedingProxy) + + if len(ret) == 0 { + panic("no return value specified for UpdateStats") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string, string, int, int, bool) error); ok { + r0 = rf(serverCity, serverCountry, serverCountryCode, p3, p4, hasSucceedingProxy) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewSession creates a new instance of Session. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSession(t interface { + mock.TestingT + Cleanup(func()) +}) *Session { + mock := &Session{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internalsdk/mocks/ad_provider.go b/internalsdk/mocks/ad_provider.go new file mode 100644 index 000000000..ea9ef82be --- /dev/null +++ b/internalsdk/mocks/ad_provider.go @@ -0,0 +1,96 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// AdProvider is an autogenerated mock type for the AdProvider type +type AdProvider struct { + mock.Mock +} + +// GetInterstitialZoneID provides a mock function with given fields: +func (_m *AdProvider) GetInterstitialZoneID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetInterstitialZoneID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetNativeBannerZoneID provides a mock function with given fields: +func (_m *AdProvider) GetNativeBannerZoneID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNativeBannerZoneID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetStandardBannerZoneID provides a mock function with given fields: +func (_m *AdProvider) GetStandardBannerZoneID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStandardBannerZoneID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// ShouldShowAd provides a mock function with given fields: +func (_m *AdProvider) ShouldShowAd() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ShouldShowAd") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// NewAdProvider creates a new instance of AdProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewAdProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *AdProvider { + mock := &AdProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internalsdk/mocks/ad_settings.go b/internalsdk/mocks/ad_settings.go new file mode 100644 index 000000000..1a174a5f6 --- /dev/null +++ b/internalsdk/mocks/ad_settings.go @@ -0,0 +1,56 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// AdSettings is an autogenerated mock type for the AdSettings type +type AdSettings struct { + mock.Mock +} + +// GetAdProvider provides a mock function with given fields: isPro, countryCode, daysSinceInstalled +func (_m *AdSettings) GetAdProvider(isPro bool, countryCode string, daysSinceInstalled int) (AdProvider, error) { + ret := _m.Called(isPro, countryCode, daysSinceInstalled) + + if len(ret) == 0 { + panic("no return value specified for GetAdProvider") + } + + var r0 AdProvider + var r1 error + if rf, ok := ret.Get(0).(func(bool, string, int) (AdProvider, error)); ok { + return rf(isPro, countryCode, daysSinceInstalled) + } + if rf, ok := ret.Get(0).(func(bool, string, int) AdProvider); ok { + r0 = rf(isPro, countryCode, daysSinceInstalled) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(AdProvider) + } + } + + if rf, ok := ret.Get(1).(func(bool, string, int) error); ok { + r1 = rf(isPro, countryCode, daysSinceInstalled) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewAdSettings creates a new instance of AdSettings. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewAdSettings(t interface { + mock.TestingT + Cleanup(func()) +}) *AdSettings { + mock := &AdSettings{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internalsdk/mocks/pro_client.go b/internalsdk/mocks/pro_client.go new file mode 100644 index 000000000..deae3bbf4 --- /dev/null +++ b/internalsdk/mocks/pro_client.go @@ -0,0 +1,1531 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + pro "github.com/getlantern/lantern-client/internalsdk/pro" + mock "github.com/stretchr/testify/mock" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + + protos "github.com/getlantern/lantern-client/internalsdk/protos" + + time "time" +) + +// ProClient is an autogenerated mock type for the ProClient type +type ProClient struct { + mock.Mock +} + +type ProClient_Expecter struct { + mock *mock.Mock +} + +func (_m *ProClient) EXPECT() *ProClient_Expecter { + return &ProClient_Expecter{mock: &_m.Mock} +} + +// DeviceAdd provides a mock function with given fields: ctx, deviceName +func (_m *ProClient) DeviceAdd(ctx context.Context, deviceName string) (bool, error) { + ret := _m.Called(ctx, deviceName) + + if len(ret) == 0 { + panic("no return value specified for DeviceAdd") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, deviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, deviceName) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, deviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_DeviceAdd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceAdd' +type ProClient_DeviceAdd_Call struct { + *mock.Call +} + +// DeviceAdd is a helper method to define mock.On call +// - ctx context.Context +// - deviceName string +func (_e *ProClient_Expecter) DeviceAdd(ctx interface{}, deviceName interface{}) *ProClient_DeviceAdd_Call { + return &ProClient_DeviceAdd_Call{Call: _e.mock.On("DeviceAdd", ctx, deviceName)} +} + +func (_c *ProClient_DeviceAdd_Call) Run(run func(ctx context.Context, deviceName string)) *ProClient_DeviceAdd_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_DeviceAdd_Call) Return(_a0 bool, _a1 error) *ProClient_DeviceAdd_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_DeviceAdd_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *ProClient_DeviceAdd_Call { + _c.Call.Return(run) + return _c +} + +// DeviceRemove provides a mock function with given fields: ctx, deviceId +func (_m *ProClient) DeviceRemove(ctx context.Context, deviceId string) (*pro.LinkResponse, error) { + ret := _m.Called(ctx, deviceId) + + if len(ret) == 0 { + panic("no return value specified for DeviceRemove") + } + + var r0 *pro.LinkResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.LinkResponse, error)); ok { + return rf(ctx, deviceId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *pro.LinkResponse); ok { + r0 = rf(ctx, deviceId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.LinkResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, deviceId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_DeviceRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceRemove' +type ProClient_DeviceRemove_Call struct { + *mock.Call +} + +// DeviceRemove is a helper method to define mock.On call +// - ctx context.Context +// - deviceId string +func (_e *ProClient_Expecter) DeviceRemove(ctx interface{}, deviceId interface{}) *ProClient_DeviceRemove_Call { + return &ProClient_DeviceRemove_Call{Call: _e.mock.On("DeviceRemove", ctx, deviceId)} +} + +func (_c *ProClient_DeviceRemove_Call) Run(run func(ctx context.Context, deviceId string)) *ProClient_DeviceRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_DeviceRemove_Call) Return(_a0 *pro.LinkResponse, _a1 error) *ProClient_DeviceRemove_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_DeviceRemove_Call) RunAndReturn(run func(context.Context, string) (*pro.LinkResponse, error)) *ProClient_DeviceRemove_Call { + _c.Call.Return(run) + return _c +} + +// EmailExists provides a mock function with given fields: ctx, email +func (_m *ProClient) EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) { + ret := _m.Called(ctx, email) + + if len(ret) == 0 { + panic("no return value specified for EmailExists") + } + + var r0 *protos.BaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { + return rf(ctx, email) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { + r0 = rf(ctx, email) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.BaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, email) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_EmailExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EmailExists' +type ProClient_EmailExists_Call struct { + *mock.Call +} + +// EmailExists is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *ProClient_Expecter) EmailExists(ctx interface{}, email interface{}) *ProClient_EmailExists_Call { + return &ProClient_EmailExists_Call{Call: _e.mock.On("EmailExists", ctx, email)} +} + +func (_c *ProClient_EmailExists_Call) Run(run func(ctx context.Context, email string)) *ProClient_EmailExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_EmailExists_Call) Return(_a0 *protos.BaseResponse, _a1 error) *ProClient_EmailExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_EmailExists_Call) RunAndReturn(run func(context.Context, string) (*protos.BaseResponse, error)) *ProClient_EmailExists_Call { + _c.Call.Return(run) + return _c +} + +// EmailRequest provides a mock function with given fields: ctx, email +func (_m *ProClient) EmailRequest(ctx context.Context, email string) (*pro.OkResponse, error) { + ret := _m.Called(ctx, email) + + if len(ret) == 0 { + panic("no return value specified for EmailRequest") + } + + var r0 *pro.OkResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.OkResponse, error)); ok { + return rf(ctx, email) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *pro.OkResponse); ok { + r0 = rf(ctx, email) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.OkResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, email) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_EmailRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EmailRequest' +type ProClient_EmailRequest_Call struct { + *mock.Call +} + +// EmailRequest is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *ProClient_Expecter) EmailRequest(ctx interface{}, email interface{}) *ProClient_EmailRequest_Call { + return &ProClient_EmailRequest_Call{Call: _e.mock.On("EmailRequest", ctx, email)} +} + +func (_c *ProClient_EmailRequest_Call) Run(run func(ctx context.Context, email string)) *ProClient_EmailRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_EmailRequest_Call) Return(_a0 *pro.OkResponse, _a1 error) *ProClient_EmailRequest_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_EmailRequest_Call) RunAndReturn(run func(context.Context, string) (*pro.OkResponse, error)) *ProClient_EmailRequest_Call { + _c.Call.Return(run) + return _c +} + +// GetJSON provides a mock function with given fields: ctx, path, params, target +func (_m *ProClient) GetJSON(ctx context.Context, path string, params any, target any) error { + ret := _m.Called(ctx, path, params, target) + + if len(ret) == 0 { + panic("no return value specified for GetJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { + r0 = rf(ctx, path, params, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProClient_GetJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJSON' +type ProClient_GetJSON_Call struct { + *mock.Call +} + +// GetJSON is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - params any +// - target any +func (_e *ProClient_Expecter) GetJSON(ctx interface{}, path interface{}, params interface{}, target interface{}) *ProClient_GetJSON_Call { + return &ProClient_GetJSON_Call{Call: _e.mock.On("GetJSON", ctx, path, params, target)} +} + +func (_c *ProClient_GetJSON_Call) Run(run func(ctx context.Context, path string, params any, target any)) *ProClient_GetJSON_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(any), args[3].(any)) + }) + return _c +} + +func (_c *ProClient_GetJSON_Call) Return(_a0 error) *ProClient_GetJSON_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProClient_GetJSON_Call) RunAndReturn(run func(context.Context, string, any, any) error) *ProClient_GetJSON_Call { + _c.Call.Return(run) + return _c +} + +// GetPROTOC provides a mock function with given fields: ctx, path, params, target +func (_m *ProClient) GetPROTOC(ctx context.Context, path string, params any, target protoreflect.ProtoMessage) error { + ret := _m.Called(ctx, path, params, target) + + if len(ret) == 0 { + panic("no return value specified for GetPROTOC") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, protoreflect.ProtoMessage) error); ok { + r0 = rf(ctx, path, params, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProClient_GetPROTOC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPROTOC' +type ProClient_GetPROTOC_Call struct { + *mock.Call +} + +// GetPROTOC is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - params any +// - target protoreflect.ProtoMessage +func (_e *ProClient_Expecter) GetPROTOC(ctx interface{}, path interface{}, params interface{}, target interface{}) *ProClient_GetPROTOC_Call { + return &ProClient_GetPROTOC_Call{Call: _e.mock.On("GetPROTOC", ctx, path, params, target)} +} + +func (_c *ProClient_GetPROTOC_Call) Run(run func(ctx context.Context, path string, params any, target protoreflect.ProtoMessage)) *ProClient_GetPROTOC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(any), args[3].(protoreflect.ProtoMessage)) + }) + return _c +} + +func (_c *ProClient_GetPROTOC_Call) Return(_a0 error) *ProClient_GetPROTOC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProClient_GetPROTOC_Call) RunAndReturn(run func(context.Context, string, any, protoreflect.ProtoMessage) error) *ProClient_GetPROTOC_Call { + _c.Call.Return(run) + return _c +} + +// LinkCodeApprove provides a mock function with given fields: ctx, code +func (_m *ProClient) LinkCodeApprove(ctx context.Context, code string) (*protos.BaseResponse, error) { + ret := _m.Called(ctx, code) + + if len(ret) == 0 { + panic("no return value specified for LinkCodeApprove") + } + + var r0 *protos.BaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { + return rf(ctx, code) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { + r0 = rf(ctx, code) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.BaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, code) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_LinkCodeApprove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkCodeApprove' +type ProClient_LinkCodeApprove_Call struct { + *mock.Call +} + +// LinkCodeApprove is a helper method to define mock.On call +// - ctx context.Context +// - code string +func (_e *ProClient_Expecter) LinkCodeApprove(ctx interface{}, code interface{}) *ProClient_LinkCodeApprove_Call { + return &ProClient_LinkCodeApprove_Call{Call: _e.mock.On("LinkCodeApprove", ctx, code)} +} + +func (_c *ProClient_LinkCodeApprove_Call) Run(run func(ctx context.Context, code string)) *ProClient_LinkCodeApprove_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_LinkCodeApprove_Call) Return(_a0 *protos.BaseResponse, _a1 error) *ProClient_LinkCodeApprove_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_LinkCodeApprove_Call) RunAndReturn(run func(context.Context, string) (*protos.BaseResponse, error)) *ProClient_LinkCodeApprove_Call { + _c.Call.Return(run) + return _c +} + +// LinkCodeRedeem provides a mock function with given fields: ctx, deviceName, deviceCode +func (_m *ProClient) LinkCodeRedeem(ctx context.Context, deviceName string, deviceCode string) (*pro.LinkCodeRedeemResponse, error) { + ret := _m.Called(ctx, deviceName, deviceCode) + + if len(ret) == 0 { + panic("no return value specified for LinkCodeRedeem") + } + + var r0 *pro.LinkCodeRedeemResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pro.LinkCodeRedeemResponse, error)); ok { + return rf(ctx, deviceName, deviceCode) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *pro.LinkCodeRedeemResponse); ok { + r0 = rf(ctx, deviceName, deviceCode) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.LinkCodeRedeemResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, deviceName, deviceCode) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_LinkCodeRedeem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkCodeRedeem' +type ProClient_LinkCodeRedeem_Call struct { + *mock.Call +} + +// LinkCodeRedeem is a helper method to define mock.On call +// - ctx context.Context +// - deviceName string +// - deviceCode string +func (_e *ProClient_Expecter) LinkCodeRedeem(ctx interface{}, deviceName interface{}, deviceCode interface{}) *ProClient_LinkCodeRedeem_Call { + return &ProClient_LinkCodeRedeem_Call{Call: _e.mock.On("LinkCodeRedeem", ctx, deviceName, deviceCode)} +} + +func (_c *ProClient_LinkCodeRedeem_Call) Run(run func(ctx context.Context, deviceName string, deviceCode string)) *ProClient_LinkCodeRedeem_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ProClient_LinkCodeRedeem_Call) Return(_a0 *pro.LinkCodeRedeemResponse, _a1 error) *ProClient_LinkCodeRedeem_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_LinkCodeRedeem_Call) RunAndReturn(run func(context.Context, string, string) (*pro.LinkCodeRedeemResponse, error)) *ProClient_LinkCodeRedeem_Call { + _c.Call.Return(run) + return _c +} + +// LinkCodeRequest provides a mock function with given fields: ctx, deviceName +func (_m *ProClient) LinkCodeRequest(ctx context.Context, deviceName string) (*pro.LinkCodeResponse, error) { + ret := _m.Called(ctx, deviceName) + + if len(ret) == 0 { + panic("no return value specified for LinkCodeRequest") + } + + var r0 *pro.LinkCodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.LinkCodeResponse, error)); ok { + return rf(ctx, deviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *pro.LinkCodeResponse); ok { + r0 = rf(ctx, deviceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.LinkCodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, deviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_LinkCodeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkCodeRequest' +type ProClient_LinkCodeRequest_Call struct { + *mock.Call +} + +// LinkCodeRequest is a helper method to define mock.On call +// - ctx context.Context +// - deviceName string +func (_e *ProClient_Expecter) LinkCodeRequest(ctx interface{}, deviceName interface{}) *ProClient_LinkCodeRequest_Call { + return &ProClient_LinkCodeRequest_Call{Call: _e.mock.On("LinkCodeRequest", ctx, deviceName)} +} + +func (_c *ProClient_LinkCodeRequest_Call) Run(run func(ctx context.Context, deviceName string)) *ProClient_LinkCodeRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_LinkCodeRequest_Call) Return(_a0 *pro.LinkCodeResponse, _a1 error) *ProClient_LinkCodeRequest_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_LinkCodeRequest_Call) RunAndReturn(run func(context.Context, string) (*pro.LinkCodeResponse, error)) *ProClient_LinkCodeRequest_Call { + _c.Call.Return(run) + return _c +} + +// PaymentMethods provides a mock function with given fields: ctx +func (_m *ProClient) PaymentMethods(ctx context.Context) (*pro.PaymentMethodsResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for PaymentMethods") + } + + var r0 *pro.PaymentMethodsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*pro.PaymentMethodsResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *pro.PaymentMethodsResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.PaymentMethodsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_PaymentMethods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PaymentMethods' +type ProClient_PaymentMethods_Call struct { + *mock.Call +} + +// PaymentMethods is a helper method to define mock.On call +// - ctx context.Context +func (_e *ProClient_Expecter) PaymentMethods(ctx interface{}) *ProClient_PaymentMethods_Call { + return &ProClient_PaymentMethods_Call{Call: _e.mock.On("PaymentMethods", ctx)} +} + +func (_c *ProClient_PaymentMethods_Call) Run(run func(ctx context.Context)) *ProClient_PaymentMethods_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ProClient_PaymentMethods_Call) Return(_a0 *pro.PaymentMethodsResponse, _a1 error) *ProClient_PaymentMethods_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_PaymentMethods_Call) RunAndReturn(run func(context.Context) (*pro.PaymentMethodsResponse, error)) *ProClient_PaymentMethods_Call { + _c.Call.Return(run) + return _c +} + +// PaymentMethodsV4 provides a mock function with given fields: ctx +func (_m *ProClient) PaymentMethodsV4(ctx context.Context) (*pro.PaymentMethodsResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for PaymentMethodsV4") + } + + var r0 *pro.PaymentMethodsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*pro.PaymentMethodsResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *pro.PaymentMethodsResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.PaymentMethodsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_PaymentMethodsV4_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PaymentMethodsV4' +type ProClient_PaymentMethodsV4_Call struct { + *mock.Call +} + +// PaymentMethodsV4 is a helper method to define mock.On call +// - ctx context.Context +func (_e *ProClient_Expecter) PaymentMethodsV4(ctx interface{}) *ProClient_PaymentMethodsV4_Call { + return &ProClient_PaymentMethodsV4_Call{Call: _e.mock.On("PaymentMethodsV4", ctx)} +} + +func (_c *ProClient_PaymentMethodsV4_Call) Run(run func(ctx context.Context)) *ProClient_PaymentMethodsV4_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ProClient_PaymentMethodsV4_Call) Return(_a0 *pro.PaymentMethodsResponse, _a1 error) *ProClient_PaymentMethodsV4_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_PaymentMethodsV4_Call) RunAndReturn(run func(context.Context) (*pro.PaymentMethodsResponse, error)) *ProClient_PaymentMethodsV4_Call { + _c.Call.Return(run) + return _c +} + +// PaymentRedirect provides a mock function with given fields: ctx, req +func (_m *ProClient) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*pro.PaymentRedirectResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for PaymentRedirect") + } + + var r0 *pro.PaymentRedirectResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) (*pro.PaymentRedirectResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) *pro.PaymentRedirectResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.PaymentRedirectResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *protos.PaymentRedirectRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_PaymentRedirect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PaymentRedirect' +type ProClient_PaymentRedirect_Call struct { + *mock.Call +} + +// PaymentRedirect is a helper method to define mock.On call +// - ctx context.Context +// - req *protos.PaymentRedirectRequest +func (_e *ProClient_Expecter) PaymentRedirect(ctx interface{}, req interface{}) *ProClient_PaymentRedirect_Call { + return &ProClient_PaymentRedirect_Call{Call: _e.mock.On("PaymentRedirect", ctx, req)} +} + +func (_c *ProClient_PaymentRedirect_Call) Run(run func(ctx context.Context, req *protos.PaymentRedirectRequest)) *ProClient_PaymentRedirect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*protos.PaymentRedirectRequest)) + }) + return _c +} + +func (_c *ProClient_PaymentRedirect_Call) Return(_a0 *pro.PaymentRedirectResponse, _a1 error) *ProClient_PaymentRedirect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_PaymentRedirect_Call) RunAndReturn(run func(context.Context, *protos.PaymentRedirectRequest) (*pro.PaymentRedirectResponse, error)) *ProClient_PaymentRedirect_Call { + _c.Call.Return(run) + return _c +} + +// Plans provides a mock function with given fields: ctx +func (_m *ProClient) Plans(ctx context.Context) (*pro.PlansResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Plans") + } + + var r0 *pro.PlansResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*pro.PlansResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *pro.PlansResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.PlansResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_Plans_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Plans' +type ProClient_Plans_Call struct { + *mock.Call +} + +// Plans is a helper method to define mock.On call +// - ctx context.Context +func (_e *ProClient_Expecter) Plans(ctx interface{}) *ProClient_Plans_Call { + return &ProClient_Plans_Call{Call: _e.mock.On("Plans", ctx)} +} + +func (_c *ProClient_Plans_Call) Run(run func(ctx context.Context)) *ProClient_Plans_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ProClient_Plans_Call) Return(_a0 *pro.PlansResponse, _a1 error) *ProClient_Plans_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_Plans_Call) RunAndReturn(run func(context.Context) (*pro.PlansResponse, error)) *ProClient_Plans_Call { + _c.Call.Return(run) + return _c +} + +// PollUserData provides a mock function with given fields: ctx, session, maxElapsedTime +func (_m *ProClient) PollUserData(ctx context.Context, session pro.ClientSession, maxElapsedTime time.Duration) { + _m.Called(ctx, session, maxElapsedTime) +} + +// ProClient_PollUserData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PollUserData' +type ProClient_PollUserData_Call struct { + *mock.Call +} + +// PollUserData is a helper method to define mock.On call +// - ctx context.Context +// - session pro.ClientSession +// - maxElapsedTime time.Duration +func (_e *ProClient_Expecter) PollUserData(ctx interface{}, session interface{}, maxElapsedTime interface{}) *ProClient_PollUserData_Call { + return &ProClient_PollUserData_Call{Call: _e.mock.On("PollUserData", ctx, session, maxElapsedTime)} +} + +func (_c *ProClient_PollUserData_Call) Run(run func(ctx context.Context, session pro.ClientSession, maxElapsedTime time.Duration)) *ProClient_PollUserData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pro.ClientSession), args[2].(time.Duration)) + }) + return _c +} + +func (_c *ProClient_PollUserData_Call) Return() *ProClient_PollUserData_Call { + _c.Call.Return() + return _c +} + +func (_c *ProClient_PollUserData_Call) RunAndReturn(run func(context.Context, pro.ClientSession, time.Duration)) *ProClient_PollUserData_Call { + _c.Call.Return(run) + return _c +} + +// PostFormReadingJSON provides a mock function with given fields: ctx, path, params, target +func (_m *ProClient) PostFormReadingJSON(ctx context.Context, path string, params any, target any) error { + ret := _m.Called(ctx, path, params, target) + + if len(ret) == 0 { + panic("no return value specified for PostFormReadingJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { + r0 = rf(ctx, path, params, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProClient_PostFormReadingJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostFormReadingJSON' +type ProClient_PostFormReadingJSON_Call struct { + *mock.Call +} + +// PostFormReadingJSON is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - params any +// - target any +func (_e *ProClient_Expecter) PostFormReadingJSON(ctx interface{}, path interface{}, params interface{}, target interface{}) *ProClient_PostFormReadingJSON_Call { + return &ProClient_PostFormReadingJSON_Call{Call: _e.mock.On("PostFormReadingJSON", ctx, path, params, target)} +} + +func (_c *ProClient_PostFormReadingJSON_Call) Run(run func(ctx context.Context, path string, params any, target any)) *ProClient_PostFormReadingJSON_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(any), args[3].(any)) + }) + return _c +} + +func (_c *ProClient_PostFormReadingJSON_Call) Return(_a0 error) *ProClient_PostFormReadingJSON_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProClient_PostFormReadingJSON_Call) RunAndReturn(run func(context.Context, string, any, any) error) *ProClient_PostFormReadingJSON_Call { + _c.Call.Return(run) + return _c +} + +// PostJSONReadingJSON provides a mock function with given fields: ctx, path, params, body, target +func (_m *ProClient) PostJSONReadingJSON(ctx context.Context, path string, params any, body any, target any) error { + ret := _m.Called(ctx, path, params, body, target) + + if len(ret) == 0 { + panic("no return value specified for PostJSONReadingJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, any, any, any) error); ok { + r0 = rf(ctx, path, params, body, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProClient_PostJSONReadingJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostJSONReadingJSON' +type ProClient_PostJSONReadingJSON_Call struct { + *mock.Call +} + +// PostJSONReadingJSON is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - params any +// - body any +// - target any +func (_e *ProClient_Expecter) PostJSONReadingJSON(ctx interface{}, path interface{}, params interface{}, body interface{}, target interface{}) *ProClient_PostJSONReadingJSON_Call { + return &ProClient_PostJSONReadingJSON_Call{Call: _e.mock.On("PostJSONReadingJSON", ctx, path, params, body, target)} +} + +func (_c *ProClient_PostJSONReadingJSON_Call) Run(run func(ctx context.Context, path string, params any, body any, target any)) *ProClient_PostJSONReadingJSON_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(any), args[3].(any), args[4].(any)) + }) + return _c +} + +func (_c *ProClient_PostJSONReadingJSON_Call) Return(_a0 error) *ProClient_PostJSONReadingJSON_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProClient_PostJSONReadingJSON_Call) RunAndReturn(run func(context.Context, string, any, any, any) error) *ProClient_PostJSONReadingJSON_Call { + _c.Call.Return(run) + return _c +} + +// PostPROTOC provides a mock function with given fields: ctx, path, params, body, target +func (_m *ProClient) PostPROTOC(ctx context.Context, path string, params protoreflect.ProtoMessage, body protoreflect.ProtoMessage, target protoreflect.ProtoMessage) error { + ret := _m.Called(ctx, path, params, body, target) + + if len(ret) == 0 { + panic("no return value specified for PostPROTOC") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, protoreflect.ProtoMessage, protoreflect.ProtoMessage, protoreflect.ProtoMessage) error); ok { + r0 = rf(ctx, path, params, body, target) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProClient_PostPROTOC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostPROTOC' +type ProClient_PostPROTOC_Call struct { + *mock.Call +} + +// PostPROTOC is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - params protoreflect.ProtoMessage +// - body protoreflect.ProtoMessage +// - target protoreflect.ProtoMessage +func (_e *ProClient_Expecter) PostPROTOC(ctx interface{}, path interface{}, params interface{}, body interface{}, target interface{}) *ProClient_PostPROTOC_Call { + return &ProClient_PostPROTOC_Call{Call: _e.mock.On("PostPROTOC", ctx, path, params, body, target)} +} + +func (_c *ProClient_PostPROTOC_Call) Run(run func(ctx context.Context, path string, params protoreflect.ProtoMessage, body protoreflect.ProtoMessage, target protoreflect.ProtoMessage)) *ProClient_PostPROTOC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(protoreflect.ProtoMessage), args[3].(protoreflect.ProtoMessage), args[4].(protoreflect.ProtoMessage)) + }) + return _c +} + +func (_c *ProClient_PostPROTOC_Call) Return(_a0 error) *ProClient_PostPROTOC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProClient_PostPROTOC_Call) RunAndReturn(run func(context.Context, string, protoreflect.ProtoMessage, protoreflect.ProtoMessage, protoreflect.ProtoMessage) error) *ProClient_PostPROTOC_Call { + _c.Call.Return(run) + return _c +} + +// PurchaseRequest provides a mock function with given fields: ctx, data +func (_m *ProClient) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*pro.PurchaseResponse, error) { + ret := _m.Called(ctx, data) + + if len(ret) == 0 { + panic("no return value specified for PurchaseRequest") + } + + var r0 *pro.PurchaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*pro.PurchaseResponse, error)); ok { + return rf(ctx, data) + } + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *pro.PurchaseResponse); ok { + r0 = rf(ctx, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.PurchaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { + r1 = rf(ctx, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_PurchaseRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PurchaseRequest' +type ProClient_PurchaseRequest_Call struct { + *mock.Call +} + +// PurchaseRequest is a helper method to define mock.On call +// - ctx context.Context +// - data map[string]interface{} +func (_e *ProClient_Expecter) PurchaseRequest(ctx interface{}, data interface{}) *ProClient_PurchaseRequest_Call { + return &ProClient_PurchaseRequest_Call{Call: _e.mock.On("PurchaseRequest", ctx, data)} +} + +func (_c *ProClient_PurchaseRequest_Call) Run(run func(ctx context.Context, data map[string]interface{})) *ProClient_PurchaseRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *ProClient_PurchaseRequest_Call) Return(_a0 *pro.PurchaseResponse, _a1 error) *ProClient_PurchaseRequest_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_PurchaseRequest_Call) RunAndReturn(run func(context.Context, map[string]interface{}) (*pro.PurchaseResponse, error)) *ProClient_PurchaseRequest_Call { + _c.Call.Return(run) + return _c +} + +// RedeemResellerCode provides a mock function with given fields: ctx, req +func (_m *ProClient) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for RedeemResellerCode") + } + + var r0 *protos.BaseResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) *protos.BaseResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.BaseResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *protos.RedeemResellerCodeRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_RedeemResellerCode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RedeemResellerCode' +type ProClient_RedeemResellerCode_Call struct { + *mock.Call +} + +// RedeemResellerCode is a helper method to define mock.On call +// - ctx context.Context +// - req *protos.RedeemResellerCodeRequest +func (_e *ProClient_Expecter) RedeemResellerCode(ctx interface{}, req interface{}) *ProClient_RedeemResellerCode_Call { + return &ProClient_RedeemResellerCode_Call{Call: _e.mock.On("RedeemResellerCode", ctx, req)} +} + +func (_c *ProClient_RedeemResellerCode_Call) Run(run func(ctx context.Context, req *protos.RedeemResellerCodeRequest)) *ProClient_RedeemResellerCode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*protos.RedeemResellerCodeRequest)) + }) + return _c +} + +func (_c *ProClient_RedeemResellerCode_Call) Return(_a0 *protos.BaseResponse, _a1 error) *ProClient_RedeemResellerCode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_RedeemResellerCode_Call) RunAndReturn(run func(context.Context, *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error)) *ProClient_RedeemResellerCode_Call { + _c.Call.Return(run) + return _c +} + +// ReferralAttach provides a mock function with given fields: ctx, refCode +func (_m *ProClient) ReferralAttach(ctx context.Context, refCode string) (bool, error) { + ret := _m.Called(ctx, refCode) + + if len(ret) == 0 { + panic("no return value specified for ReferralAttach") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, refCode) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, refCode) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, refCode) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_ReferralAttach_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReferralAttach' +type ProClient_ReferralAttach_Call struct { + *mock.Call +} + +// ReferralAttach is a helper method to define mock.On call +// - ctx context.Context +// - refCode string +func (_e *ProClient_Expecter) ReferralAttach(ctx interface{}, refCode interface{}) *ProClient_ReferralAttach_Call { + return &ProClient_ReferralAttach_Call{Call: _e.mock.On("ReferralAttach", ctx, refCode)} +} + +func (_c *ProClient_ReferralAttach_Call) Run(run func(ctx context.Context, refCode string)) *ProClient_ReferralAttach_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_ReferralAttach_Call) Return(_a0 bool, _a1 error) *ProClient_ReferralAttach_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_ReferralAttach_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *ProClient_ReferralAttach_Call { + _c.Call.Return(run) + return _c +} + +// RestorePurchase provides a mock function with given fields: ctx, req +func (_m *ProClient) RestorePurchase(ctx context.Context, req map[string]interface{}) (*pro.OkResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for RestorePurchase") + } + + var r0 *pro.OkResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*pro.OkResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *pro.OkResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.OkResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_RestorePurchase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestorePurchase' +type ProClient_RestorePurchase_Call struct { + *mock.Call +} + +// RestorePurchase is a helper method to define mock.On call +// - ctx context.Context +// - req map[string]interface{} +func (_e *ProClient_Expecter) RestorePurchase(ctx interface{}, req interface{}) *ProClient_RestorePurchase_Call { + return &ProClient_RestorePurchase_Call{Call: _e.mock.On("RestorePurchase", ctx, req)} +} + +func (_c *ProClient_RestorePurchase_Call) Run(run func(ctx context.Context, req map[string]interface{})) *ProClient_RestorePurchase_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *ProClient_RestorePurchase_Call) Return(_a0 *pro.OkResponse, _a1 error) *ProClient_RestorePurchase_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_RestorePurchase_Call) RunAndReturn(run func(context.Context, map[string]interface{}) (*pro.OkResponse, error)) *ProClient_RestorePurchase_Call { + _c.Call.Return(run) + return _c +} + +// RetryCreateUser provides a mock function with given fields: ctx, ss, maxElapsedTime +func (_m *ProClient) RetryCreateUser(ctx context.Context, ss pro.ClientSession, maxElapsedTime time.Duration) { + _m.Called(ctx, ss, maxElapsedTime) +} + +// ProClient_RetryCreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetryCreateUser' +type ProClient_RetryCreateUser_Call struct { + *mock.Call +} + +// RetryCreateUser is a helper method to define mock.On call +// - ctx context.Context +// - ss pro.ClientSession +// - maxElapsedTime time.Duration +func (_e *ProClient_Expecter) RetryCreateUser(ctx interface{}, ss interface{}, maxElapsedTime interface{}) *ProClient_RetryCreateUser_Call { + return &ProClient_RetryCreateUser_Call{Call: _e.mock.On("RetryCreateUser", ctx, ss, maxElapsedTime)} +} + +func (_c *ProClient_RetryCreateUser_Call) Run(run func(ctx context.Context, ss pro.ClientSession, maxElapsedTime time.Duration)) *ProClient_RetryCreateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pro.ClientSession), args[2].(time.Duration)) + }) + return _c +} + +func (_c *ProClient_RetryCreateUser_Call) Return() *ProClient_RetryCreateUser_Call { + _c.Call.Return() + return _c +} + +func (_c *ProClient_RetryCreateUser_Call) RunAndReturn(run func(context.Context, pro.ClientSession, time.Duration)) *ProClient_RetryCreateUser_Call { + _c.Call.Return(run) + return _c +} + +// UpdateUserData provides a mock function with given fields: ctx, ss +func (_m *ProClient) UpdateUserData(ctx context.Context, ss pro.ClientSession) (*protos.User, error) { + ret := _m.Called(ctx, ss) + + if len(ret) == 0 { + panic("no return value specified for UpdateUserData") + } + + var r0 *protos.User + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pro.ClientSession) (*protos.User, error)); ok { + return rf(ctx, ss) + } + if rf, ok := ret.Get(0).(func(context.Context, pro.ClientSession) *protos.User); ok { + r0 = rf(ctx, ss) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*protos.User) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, pro.ClientSession) error); ok { + r1 = rf(ctx, ss) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_UpdateUserData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUserData' +type ProClient_UpdateUserData_Call struct { + *mock.Call +} + +// UpdateUserData is a helper method to define mock.On call +// - ctx context.Context +// - ss pro.ClientSession +func (_e *ProClient_Expecter) UpdateUserData(ctx interface{}, ss interface{}) *ProClient_UpdateUserData_Call { + return &ProClient_UpdateUserData_Call{Call: _e.mock.On("UpdateUserData", ctx, ss)} +} + +func (_c *ProClient_UpdateUserData_Call) Run(run func(ctx context.Context, ss pro.ClientSession)) *ProClient_UpdateUserData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pro.ClientSession)) + }) + return _c +} + +func (_c *ProClient_UpdateUserData_Call) Return(_a0 *protos.User, _a1 error) *ProClient_UpdateUserData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_UpdateUserData_Call) RunAndReturn(run func(context.Context, pro.ClientSession) (*protos.User, error)) *ProClient_UpdateUserData_Call { + _c.Call.Return(run) + return _c +} + +// UserCreate provides a mock function with given fields: ctx +func (_m *ProClient) UserCreate(ctx context.Context) (*pro.UserDataResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for UserCreate") + } + + var r0 *pro.UserDataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*pro.UserDataResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *pro.UserDataResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.UserDataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_UserCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserCreate' +type ProClient_UserCreate_Call struct { + *mock.Call +} + +// UserCreate is a helper method to define mock.On call +// - ctx context.Context +func (_e *ProClient_Expecter) UserCreate(ctx interface{}) *ProClient_UserCreate_Call { + return &ProClient_UserCreate_Call{Call: _e.mock.On("UserCreate", ctx)} +} + +func (_c *ProClient_UserCreate_Call) Run(run func(ctx context.Context)) *ProClient_UserCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ProClient_UserCreate_Call) Return(_a0 *pro.UserDataResponse, _a1 error) *ProClient_UserCreate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_UserCreate_Call) RunAndReturn(run func(context.Context) (*pro.UserDataResponse, error)) *ProClient_UserCreate_Call { + _c.Call.Return(run) + return _c +} + +// UserData provides a mock function with given fields: ctx +func (_m *ProClient) UserData(ctx context.Context) (*pro.UserDataResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for UserData") + } + + var r0 *pro.UserDataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*pro.UserDataResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *pro.UserDataResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.UserDataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_UserData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserData' +type ProClient_UserData_Call struct { + *mock.Call +} + +// UserData is a helper method to define mock.On call +// - ctx context.Context +func (_e *ProClient_Expecter) UserData(ctx interface{}) *ProClient_UserData_Call { + return &ProClient_UserData_Call{Call: _e.mock.On("UserData", ctx)} +} + +func (_c *ProClient_UserData_Call) Run(run func(ctx context.Context)) *ProClient_UserData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ProClient_UserData_Call) Return(_a0 *pro.UserDataResponse, _a1 error) *ProClient_UserData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_UserData_Call) RunAndReturn(run func(context.Context) (*pro.UserDataResponse, error)) *ProClient_UserData_Call { + _c.Call.Return(run) + return _c +} + +// UserLinkCodeRequest provides a mock function with given fields: ctx, deviceId, email +func (_m *ProClient) UserLinkCodeRequest(ctx context.Context, deviceId string, email string) (bool, error) { + ret := _m.Called(ctx, deviceId, email) + + if len(ret) == 0 { + panic("no return value specified for UserLinkCodeRequest") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { + return rf(ctx, deviceId, email) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, deviceId, email) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, deviceId, email) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_UserLinkCodeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserLinkCodeRequest' +type ProClient_UserLinkCodeRequest_Call struct { + *mock.Call +} + +// UserLinkCodeRequest is a helper method to define mock.On call +// - ctx context.Context +// - deviceId string +// - email string +func (_e *ProClient_Expecter) UserLinkCodeRequest(ctx interface{}, deviceId interface{}, email interface{}) *ProClient_UserLinkCodeRequest_Call { + return &ProClient_UserLinkCodeRequest_Call{Call: _e.mock.On("UserLinkCodeRequest", ctx, deviceId, email)} +} + +func (_c *ProClient_UserLinkCodeRequest_Call) Run(run func(ctx context.Context, deviceId string, email string)) *ProClient_UserLinkCodeRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ProClient_UserLinkCodeRequest_Call) Return(_a0 bool, _a1 error) *ProClient_UserLinkCodeRequest_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_UserLinkCodeRequest_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *ProClient_UserLinkCodeRequest_Call { + _c.Call.Return(run) + return _c +} + +// UserLinkValidate provides a mock function with given fields: ctx, code +func (_m *ProClient) UserLinkValidate(ctx context.Context, code string) (*pro.UserRecovery, error) { + ret := _m.Called(ctx, code) + + if len(ret) == 0 { + panic("no return value specified for UserLinkValidate") + } + + var r0 *pro.UserRecovery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*pro.UserRecovery, error)); ok { + return rf(ctx, code) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *pro.UserRecovery); ok { + r0 = rf(ctx, code) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pro.UserRecovery) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, code) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProClient_UserLinkValidate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserLinkValidate' +type ProClient_UserLinkValidate_Call struct { + *mock.Call +} + +// UserLinkValidate is a helper method to define mock.On call +// - ctx context.Context +// - code string +func (_e *ProClient_Expecter) UserLinkValidate(ctx interface{}, code interface{}) *ProClient_UserLinkValidate_Call { + return &ProClient_UserLinkValidate_Call{Call: _e.mock.On("UserLinkValidate", ctx, code)} +} + +func (_c *ProClient_UserLinkValidate_Call) Run(run func(ctx context.Context, code string)) *ProClient_UserLinkValidate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ProClient_UserLinkValidate_Call) Return(_a0 *pro.UserRecovery, _a1 error) *ProClient_UserLinkValidate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProClient_UserLinkValidate_Call) RunAndReturn(run func(context.Context, string) (*pro.UserRecovery, error)) *ProClient_UserLinkValidate_Call { + _c.Call.Return(run) + return _c +} + +// NewProClient creates a new instance of ProClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewProClient(t interface { + mock.TestingT + Cleanup(func()) +}) *ProClient { + mock := &ProClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internalsdk/pro/mockclientsession.go b/internalsdk/pro/mockclientsession.go deleted file mode 100644 index 2ff5fc760..000000000 --- a/internalsdk/pro/mockclientsession.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package pro - -import mock "github.com/stretchr/testify/mock" - -// MockClientSession is an autogenerated mock type for the ClientSession type -type MockClientSession struct { - mock.Mock -} - -// GetDeviceID provides a mock function with given fields: -func (_m *MockClientSession) GetDeviceID() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetDeviceID") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// GetToken provides a mock function with given fields: -func (_m *MockClientSession) GetToken() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetToken") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// GetUserFirstVisit provides a mock function with given fields: -func (_m *MockClientSession) GetUserFirstVisit() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetUserFirstVisit") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// GetUserID provides a mock function with given fields: -func (_m *MockClientSession) GetUserID() int64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetUserID") - } - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// Locale provides a mock function with given fields: -func (_m *MockClientSession) Locale() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Locale") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// SetExpiration provides a mock function with given fields: _a0 -func (_m *MockClientSession) SetExpiration(_a0 int64) { - _m.Called(_a0) -} - -// SetProUser provides a mock function with given fields: _a0 -func (_m *MockClientSession) SetProUser(_a0 bool) { - _m.Called(_a0) -} - -// SetReferralCode provides a mock function with given fields: _a0 -func (_m *MockClientSession) SetReferralCode(_a0 string) { - _m.Called(_a0) -} - -// SetUserIDAndToken provides a mock function with given fields: _a0, _a1 -func (_m *MockClientSession) SetUserIDAndToken(_a0 int64, _a1 string) { - _m.Called(_a0, _a1) -} - -// NewMockClientSession creates a new instance of MockClientSession. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockClientSession(t interface { - mock.TestingT - Cleanup(func()) -}) *MockClientSession { - mock := &MockClientSession{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internalsdk/pro/mockproclient.go b/internalsdk/pro/mockproclient.go deleted file mode 100644 index d313e2cbe..000000000 --- a/internalsdk/pro/mockproclient.go +++ /dev/null @@ -1,728 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package pro - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - - protos "github.com/getlantern/lantern-client/internalsdk/protos" - - time "time" -) - -// MockProClient is an autogenerated mock type for the ProClient type -type MockProClient struct { - mock.Mock -} - -// DeviceAdd provides a mock function with given fields: ctx, deviceName -func (_m *MockProClient) DeviceAdd(ctx context.Context, deviceName string) (bool, error) { - ret := _m.Called(ctx, deviceName) - - if len(ret) == 0 { - panic("no return value specified for DeviceAdd") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { - return rf(ctx, deviceName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { - r0 = rf(ctx, deviceName) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, deviceName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeviceRemove provides a mock function with given fields: ctx, deviceId -func (_m *MockProClient) DeviceRemove(ctx context.Context, deviceId string) (*LinkResponse, error) { - ret := _m.Called(ctx, deviceId) - - if len(ret) == 0 { - panic("no return value specified for DeviceRemove") - } - - var r0 *LinkResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*LinkResponse, error)); ok { - return rf(ctx, deviceId) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *LinkResponse); ok { - r0 = rf(ctx, deviceId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*LinkResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, deviceId) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EmailExists provides a mock function with given fields: ctx, email -func (_m *MockProClient) EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) { - ret := _m.Called(ctx, email) - - if len(ret) == 0 { - panic("no return value specified for EmailExists") - } - - var r0 *protos.BaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { - return rf(ctx, email) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { - r0 = rf(ctx, email) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.BaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, email) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EmailRequest provides a mock function with given fields: ctx, email -func (_m *MockProClient) EmailRequest(ctx context.Context, email string) (*OkResponse, error) { - ret := _m.Called(ctx, email) - - if len(ret) == 0 { - panic("no return value specified for EmailRequest") - } - - var r0 *OkResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*OkResponse, error)); ok { - return rf(ctx, email) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *OkResponse); ok { - r0 = rf(ctx, email) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*OkResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, email) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetJSON provides a mock function with given fields: ctx, path, params, target -func (_m *MockProClient) GetJSON(ctx context.Context, path string, params any, target any) error { - ret := _m.Called(ctx, path, params, target) - - if len(ret) == 0 { - panic("no return value specified for GetJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { - r0 = rf(ctx, path, params, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetPROTOC provides a mock function with given fields: ctx, path, params, target -func (_m *MockProClient) GetPROTOC(ctx context.Context, path string, params any, target protoreflect.ProtoMessage) error { - ret := _m.Called(ctx, path, params, target) - - if len(ret) == 0 { - panic("no return value specified for GetPROTOC") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, protoreflect.ProtoMessage) error); ok { - r0 = rf(ctx, path, params, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// LinkCodeApprove provides a mock function with given fields: ctx, code -func (_m *MockProClient) LinkCodeApprove(ctx context.Context, code string) (*protos.BaseResponse, error) { - ret := _m.Called(ctx, code) - - if len(ret) == 0 { - panic("no return value specified for LinkCodeApprove") - } - - var r0 *protos.BaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*protos.BaseResponse, error)); ok { - return rf(ctx, code) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *protos.BaseResponse); ok { - r0 = rf(ctx, code) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.BaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, code) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LinkCodeRedeem provides a mock function with given fields: ctx, deviceName, deviceCode -func (_m *MockProClient) LinkCodeRedeem(ctx context.Context, deviceName string, deviceCode string) (*LinkCodeRedeemResponse, error) { - ret := _m.Called(ctx, deviceName, deviceCode) - - if len(ret) == 0 { - panic("no return value specified for LinkCodeRedeem") - } - - var r0 *LinkCodeRedeemResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*LinkCodeRedeemResponse, error)); ok { - return rf(ctx, deviceName, deviceCode) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *LinkCodeRedeemResponse); ok { - r0 = rf(ctx, deviceName, deviceCode) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*LinkCodeRedeemResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, deviceName, deviceCode) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LinkCodeRequest provides a mock function with given fields: ctx, deviceName -func (_m *MockProClient) LinkCodeRequest(ctx context.Context, deviceName string) (*LinkCodeResponse, error) { - ret := _m.Called(ctx, deviceName) - - if len(ret) == 0 { - panic("no return value specified for LinkCodeRequest") - } - - var r0 *LinkCodeResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*LinkCodeResponse, error)); ok { - return rf(ctx, deviceName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *LinkCodeResponse); ok { - r0 = rf(ctx, deviceName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*LinkCodeResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, deviceName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PaymentMethods provides a mock function with given fields: ctx -func (_m *MockProClient) PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for PaymentMethods") - } - - var r0 *PaymentMethodsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*PaymentMethodsResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *PaymentMethodsResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*PaymentMethodsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PaymentMethodsV4 provides a mock function with given fields: ctx -func (_m *MockProClient) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for PaymentMethodsV4") - } - - var r0 *PaymentMethodsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*PaymentMethodsResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *PaymentMethodsResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*PaymentMethodsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PaymentRedirect provides a mock function with given fields: ctx, req -func (_m *MockProClient) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for PaymentRedirect") - } - - var r0 *PaymentRedirectResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, *protos.PaymentRedirectRequest) *PaymentRedirectResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*PaymentRedirectResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *protos.PaymentRedirectRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Plans provides a mock function with given fields: ctx -func (_m *MockProClient) Plans(ctx context.Context) (*PlansResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Plans") - } - - var r0 *PlansResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*PlansResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *PlansResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*PlansResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PollUserData provides a mock function with given fields: ctx, session, maxElapsedTime -func (_m *MockProClient) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration) { - _m.Called(ctx, session, maxElapsedTime) -} - -// PostFormReadingJSON provides a mock function with given fields: ctx, path, params, target -func (_m *MockProClient) PostFormReadingJSON(ctx context.Context, path string, params any, target any) error { - ret := _m.Called(ctx, path, params, target) - - if len(ret) == 0 { - panic("no return value specified for PostFormReadingJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, any) error); ok { - r0 = rf(ctx, path, params, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PostJSONReadingJSON provides a mock function with given fields: ctx, path, params, body, target -func (_m *MockProClient) PostJSONReadingJSON(ctx context.Context, path string, params any, body any, target any) error { - ret := _m.Called(ctx, path, params, body, target) - - if len(ret) == 0 { - panic("no return value specified for PostJSONReadingJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, any, any, any) error); ok { - r0 = rf(ctx, path, params, body, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PostPROTOC provides a mock function with given fields: ctx, path, params, body, target -func (_m *MockProClient) PostPROTOC(ctx context.Context, path string, params protoreflect.ProtoMessage, body protoreflect.ProtoMessage, target protoreflect.ProtoMessage) error { - ret := _m.Called(ctx, path, params, body, target) - - if len(ret) == 0 { - panic("no return value specified for PostPROTOC") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, protoreflect.ProtoMessage, protoreflect.ProtoMessage, protoreflect.ProtoMessage) error); ok { - r0 = rf(ctx, path, params, body, target) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PurchaseRequest provides a mock function with given fields: ctx, data -func (_m *MockProClient) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) { - ret := _m.Called(ctx, data) - - if len(ret) == 0 { - panic("no return value specified for PurchaseRequest") - } - - var r0 *PurchaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*PurchaseResponse, error)); ok { - return rf(ctx, data) - } - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *PurchaseResponse); ok { - r0 = rf(ctx, data) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*PurchaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { - r1 = rf(ctx, data) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RedeemResellerCode provides a mock function with given fields: ctx, req -func (_m *MockProClient) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for RedeemResellerCode") - } - - var r0 *protos.BaseResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, *protos.RedeemResellerCodeRequest) *protos.BaseResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.BaseResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *protos.RedeemResellerCodeRequest) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReferralAttach provides a mock function with given fields: ctx, refCode -func (_m *MockProClient) ReferralAttach(ctx context.Context, refCode string) (bool, error) { - ret := _m.Called(ctx, refCode) - - if len(ret) == 0 { - panic("no return value specified for ReferralAttach") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { - return rf(ctx, refCode) - } - if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { - r0 = rf(ctx, refCode) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, refCode) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RestorePurchase provides a mock function with given fields: ctx, req -func (_m *MockProClient) RestorePurchase(ctx context.Context, req map[string]interface{}) (*OkResponse, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for RestorePurchase") - } - - var r0 *OkResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*OkResponse, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *OkResponse); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*OkResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RetryCreateUser provides a mock function with given fields: ctx, ss, maxElapsedTime -func (_m *MockProClient) RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) { - _m.Called(ctx, ss, maxElapsedTime) -} - -// UpdateUserData provides a mock function with given fields: ctx, ss -func (_m *MockProClient) UpdateUserData(ctx context.Context, ss ClientSession) (*protos.User, error) { - ret := _m.Called(ctx, ss) - - if len(ret) == 0 { - panic("no return value specified for UpdateUserData") - } - - var r0 *protos.User - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ClientSession) (*protos.User, error)); ok { - return rf(ctx, ss) - } - if rf, ok := ret.Get(0).(func(context.Context, ClientSession) *protos.User); ok { - r0 = rf(ctx, ss) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*protos.User) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, ClientSession) error); ok { - r1 = rf(ctx, ss) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserCreate provides a mock function with given fields: ctx -func (_m *MockProClient) UserCreate(ctx context.Context) (*UserDataResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for UserCreate") - } - - var r0 *UserDataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*UserDataResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *UserDataResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*UserDataResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserData provides a mock function with given fields: ctx -func (_m *MockProClient) UserData(ctx context.Context) (*UserDataResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for UserData") - } - - var r0 *UserDataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*UserDataResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *UserDataResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*UserDataResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserLinkCodeRequest provides a mock function with given fields: ctx, deviceId, email -func (_m *MockProClient) UserLinkCodeRequest(ctx context.Context, deviceId string, email string) (bool, error) { - ret := _m.Called(ctx, deviceId, email) - - if len(ret) == 0 { - panic("no return value specified for UserLinkCodeRequest") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { - return rf(ctx, deviceId, email) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { - r0 = rf(ctx, deviceId, email) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, deviceId, email) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserLinkValidate provides a mock function with given fields: ctx, code -func (_m *MockProClient) UserLinkValidate(ctx context.Context, code string) (*UserRecovery, error) { - ret := _m.Called(ctx, code) - - if len(ret) == 0 { - panic("no return value specified for UserLinkValidate") - } - - var r0 *UserRecovery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*UserRecovery, error)); ok { - return rf(ctx, code) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *UserRecovery); ok { - r0 = rf(ctx, code) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*UserRecovery) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, code) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewMockProClient creates a new instance of MockProClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockProClient(t interface { - mock.TestingT - Cleanup(func()) -}) *MockProClient { - mock := &MockProClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index fc88a630a..ba65a83c0 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -30,23 +30,25 @@ type proClient struct { webclient.RESTClient backoffRunner *backoffRunner userConfig func() common.UserConfig - client ProClient } -//go:generate mockery --name=ProClient --output=../mocks/proclient --with-expecter +type Client interface { + UpdateUserData(ctx context.Context, session ClientSession) (*protos.User, error) +} + type ProClient interface { webclient.RESTClient + Client EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) Plans(ctx context.Context) (*PlansResponse, error) - PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration) + PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration, client Client) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) UserCreate(ctx context.Context) (*UserDataResponse, error) UserData(ctx context.Context) (*UserDataResponse, error) - UpdateUserData(ctx context.Context, ss ClientSession) (*protos.User, error) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) RestorePurchase(ctx context.Context, req map[string]interface{}) (*OkResponse, error) EmailRequest(ctx context.Context, email string) (*OkResponse, error) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index a88b69e1d..7bd712175 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -106,7 +106,8 @@ func (c *proClient) UpdateUserData(ctx context.Context, ss ClientSession) (*prot } // RetryCreateUser is used to retry creating a user with an exponential backoff strategy -func (c *proClient) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration) { +func (c *proClient) PollUserData(ctx context.Context, session ClientSession, + maxElapsedTime time.Duration, client Client) { log.Debug("Polling user data") b := c.backoffRunner b.mu.Lock() @@ -133,7 +134,7 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, max // Add jitter to backoff interval expBackoff.RandomizationFactor = 0.5 - if _, err := c.UpdateUserData(ctx, session); err != nil { + if _, err := client.UpdateUserData(ctx, session); err != nil { log.Errorf("Initial user data update failed: %v", err) } @@ -146,7 +147,7 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, max log.Errorf("Poll user data cancelled: %v", ctx.Err()) return case <-timer.C: - _, err := c.UpdateUserData(ctx, session) + _, err := client.UpdateUserData(ctx, session) if err != nil { if ctx.Err() != nil { log.Errorf("UpdateUserData terminated due to context: %v", ctx.Err()) diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go index 164b100af..43152f9a7 100644 --- a/internalsdk/pro/user_test.go +++ b/internalsdk/pro/user_test.go @@ -3,6 +3,7 @@ package pro import ( "context" "testing" + "time" "github.com/getlantern/errors" "github.com/getlantern/lantern-client/internalsdk/protos" @@ -10,41 +11,81 @@ import ( "github.com/stretchr/testify/mock" ) -func TestCreateUser_Success(t *testing.T) { - mockClient := new(MockProClient) - mockSession := new(MockClientSession) - - // Set up expected behavior - mockClient.On("UserCreate", mock.Anything).Return(&UserDataResponse{ - User: &protos.User{ - UserId: 123, - Token: "test-token", - }, - }, nil) - mockClient.On("SetUserIdAndToken", int64(123), "test-token").Return(nil) - - _, err := mockClient.UserCreate(context.Background()) - assert.NoError(t, err, "expected no error") - // Verify that UserCreate and SetUserIdAndToken were called once - mockClient.AssertCalled(t, "UserCreate", mock.Anything) - mockSession.AssertCalled(t, "SetUserIdAndToken", int64(123), "test-token") +// Define the mock proClient +type mockProClient struct { + mock.Mock } -func TestCreateUser_Failure(t *testing.T) { - mockClient := new(MockProClient) +func (m *mockProClient) UpdateUserData(ctx context.Context, session ClientSession) (*protos.User, error) { + args := m.Called(ctx, session) + user, _ := args.Get(0).(*protos.User) + return user, args.Error(1) +} + +// Test PollUserData +func TestPollUserData(t *testing.T) { + mockClient := new(mockProClient) + var session ClientSession + + // Configure the mock behavior + mockClient.On("UpdateUserData", mock.Anything, session).Return(nil, nil) + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + + c := &proClient{ + backoffRunner: &backoffRunner{}, + } + + // Run PollUserData + go c.PollUserData(ctx, session, 10*time.Second, mockClient) + + // Wait for the context to expire + time.Sleep(12 * time.Second) - mockClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) + // Count the number of calls + callCount := 0 + for _, call := range mockClient.Calls { + if call.Method == "UpdateUserData" { + callCount++ + } + } - _, err := mockClient.UserCreate(context.Background()) - assert.Error(t, err, "expected an error") - mockClient.AssertCalled(t, "UserCreate", mock.Anything) + // Verify the minimum number of calls + assert.GreaterOrEqual(t, callCount, 2, "Expected UpdateUserData to be called at least twice") } -type mockClient struct { - mock.Mock +// Test PollUserData Handles Errors +func TestPollUserDataWithError(t *testing.T) { + mockClient := new(mockProClient) + var session ClientSession + + // Configure the mock to simulate errors + mockClient.On("UpdateUserData", mock.Anything, session).Return(nil, errors.New("mock error")) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + c := &proClient{ + backoffRunner: &backoffRunner{}, + } + + // Run PollUserData + go c.PollUserData(ctx, session, 5*time.Second, mockClient) + + // Wait for the context to expire + time.Sleep(6 * time.Second) + + // Verify that UpdateUserData was retried multiple times + AssertAtLeastCalled(t, &mockClient.Mock, "UpdateUserData", 2) } -func (m *mockClient) UpdateUserData(ctx context.Context, session ClientSession) (interface{}, error) { - args := m.Called(ctx, session) - return args.Get(0), args.Error(1) +func AssertAtLeastCalled(t *testing.T, mock *mock.Mock, methodName string, minCalls int) { + callCount := 0 + for _, call := range mock.Calls { + if call.Method == methodName { + callCount++ + } + } + assert.GreaterOrEqual(t, callCount, minCalls, "Expected at least %d calls to %s, but got %d", minCalls, methodName, callCount) } From 18b9fcdd999861ea0aebbaaa126fddb218c02953 Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 21:33:26 -0800 Subject: [PATCH 08/23] Add client session mock --- internalsdk/mocks/client_session.go | 134 ++++++++++++++++++++++++++++ internalsdk/user_test.go | 52 +++++++++++ 2 files changed, 186 insertions(+) create mode 100644 internalsdk/mocks/client_session.go create mode 100644 internalsdk/user_test.go diff --git a/internalsdk/mocks/client_session.go b/internalsdk/mocks/client_session.go new file mode 100644 index 000000000..ae7dcee86 --- /dev/null +++ b/internalsdk/mocks/client_session.go @@ -0,0 +1,134 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// ClientSession is an autogenerated mock type for the ClientSession type +type ClientSession struct { + mock.Mock +} + +// GetDeviceID provides a mock function with given fields: +func (_m *ClientSession) GetDeviceID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDeviceID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetToken provides a mock function with given fields: +func (_m *ClientSession) GetToken() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetToken") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetUserFirstVisit provides a mock function with given fields: +func (_m *ClientSession) GetUserFirstVisit() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUserFirstVisit") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// GetUserID provides a mock function with given fields: +func (_m *ClientSession) GetUserID() int64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUserID") + } + + var r0 int64 + if rf, ok := ret.Get(0).(func() int64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int64) + } + + return r0 +} + +// Locale provides a mock function with given fields: +func (_m *ClientSession) Locale() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Locale") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// SetExpiration provides a mock function with given fields: _a0 +func (_m *ClientSession) SetExpiration(_a0 int64) { + _m.Called(_a0) +} + +// SetProUser provides a mock function with given fields: _a0 +func (_m *ClientSession) SetProUser(_a0 bool) { + _m.Called(_a0) +} + +// SetReferralCode provides a mock function with given fields: _a0 +func (_m *ClientSession) SetReferralCode(_a0 string) { + _m.Called(_a0) +} + +// SetUserIDAndToken provides a mock function with given fields: _a0, _a1 +func (_m *ClientSession) SetUserIDAndToken(_a0 int64, _a1 string) { + _m.Called(_a0, _a1) +} + +// NewClientSession creates a new instance of ClientSession. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClientSession(t interface { + mock.TestingT + Cleanup(func()) +}) *ClientSession { + mock := &ClientSession{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internalsdk/user_test.go b/internalsdk/user_test.go new file mode 100644 index 000000000..65df20729 --- /dev/null +++ b/internalsdk/user_test.go @@ -0,0 +1,52 @@ +package internalsdk + +import ( + "context" + "testing" + + "github.com/getlantern/errors" + "github.com/getlantern/lantern-client/internalsdk/mocks" + "github.com/getlantern/lantern-client/internalsdk/pro" + "github.com/getlantern/lantern-client/internalsdk/protos" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func TestCreateUser_Success(t *testing.T) { + mockClient := new(mocks.ProClient) + mockSession := new(mocks.ClientSession) + + // Set up expected behavior + mockClient.On("UserCreate", mock.Anything).Return(&pro.UserDataResponse{ + User: &protos.User{ + UserId: 123, + Token: "test-token", + }, + }, nil) + mockClient.On("SetUserIDAndToken", int64(123), "test-token").Return(nil) + + _, err := mockClient.UserCreate(context.Background()) + assert.NoError(t, err, "expected no error") + // Verify that UserCreate and SetUserIdAndToken were called once + mockClient.AssertCalled(t, "UserCreate", mock.Anything) + mockSession.AssertCalled(t, "SetUserIDAndToken", int64(123), "test-token") +} + +func TestCreateUser_Failure(t *testing.T) { + mockClient := new(mocks.ProClient) + + mockClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) + + _, err := mockClient.UserCreate(context.Background()) + assert.Error(t, err, "expected an error") + mockClient.AssertCalled(t, "UserCreate", mock.Anything) +} + +type mockClient struct { + mock.Mock +} + +func (m *mockClient) UpdateUserData(ctx context.Context, session pro.ClientSession) (interface{}, error) { + args := m.Called(ctx, session) + return args.Get(0), args.Error(1) +} From 2f83a2f3fab2118e0e3deff4dac701d1b99c5442 Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 21:36:07 -0800 Subject: [PATCH 09/23] clean-ups --- internalsdk/pro/user.go | 3 +-- internalsdk/pro/user_test.go | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index 7bd712175..e6ae3bb4b 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -19,7 +19,6 @@ type UserConfig interface { Locale() string } -// ClientSession represents a client session type ClientSession interface { UserConfig SetExpiration(int64) @@ -105,7 +104,7 @@ func (c *proClient) UpdateUserData(ctx context.Context, ss ClientSession) (*prot return user, nil } -// RetryCreateUser is used to retry creating a user with an exponential backoff strategy +// PollUserData polls for user data with a retry handler up to max elapsed time func (c *proClient) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration, client Client) { log.Debug("Polling user data") diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go index 43152f9a7..b30223ec1 100644 --- a/internalsdk/pro/user_test.go +++ b/internalsdk/pro/user_test.go @@ -40,7 +40,6 @@ func TestPollUserData(t *testing.T) { // Run PollUserData go c.PollUserData(ctx, session, 10*time.Second, mockClient) - // Wait for the context to expire time.Sleep(12 * time.Second) // Count the number of calls From aacff9203db5ba2872abb188446433868c314e5b Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 21:49:16 -0800 Subject: [PATCH 10/23] clean-ups --- internalsdk/pro/user_test.go | 90 ------------------------------------ 1 file changed, 90 deletions(-) delete mode 100644 internalsdk/pro/user_test.go diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go deleted file mode 100644 index b30223ec1..000000000 --- a/internalsdk/pro/user_test.go +++ /dev/null @@ -1,90 +0,0 @@ -package pro - -import ( - "context" - "testing" - "time" - - "github.com/getlantern/errors" - "github.com/getlantern/lantern-client/internalsdk/protos" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" -) - -// Define the mock proClient -type mockProClient struct { - mock.Mock -} - -func (m *mockProClient) UpdateUserData(ctx context.Context, session ClientSession) (*protos.User, error) { - args := m.Called(ctx, session) - user, _ := args.Get(0).(*protos.User) - return user, args.Error(1) -} - -// Test PollUserData -func TestPollUserData(t *testing.T) { - mockClient := new(mockProClient) - var session ClientSession - - // Configure the mock behavior - mockClient.On("UpdateUserData", mock.Anything, session).Return(nil, nil) - - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - - c := &proClient{ - backoffRunner: &backoffRunner{}, - } - - // Run PollUserData - go c.PollUserData(ctx, session, 10*time.Second, mockClient) - - time.Sleep(12 * time.Second) - - // Count the number of calls - callCount := 0 - for _, call := range mockClient.Calls { - if call.Method == "UpdateUserData" { - callCount++ - } - } - - // Verify the minimum number of calls - assert.GreaterOrEqual(t, callCount, 2, "Expected UpdateUserData to be called at least twice") -} - -// Test PollUserData Handles Errors -func TestPollUserDataWithError(t *testing.T) { - mockClient := new(mockProClient) - var session ClientSession - - // Configure the mock to simulate errors - mockClient.On("UpdateUserData", mock.Anything, session).Return(nil, errors.New("mock error")) - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - c := &proClient{ - backoffRunner: &backoffRunner{}, - } - - // Run PollUserData - go c.PollUserData(ctx, session, 5*time.Second, mockClient) - - // Wait for the context to expire - time.Sleep(6 * time.Second) - - // Verify that UpdateUserData was retried multiple times - AssertAtLeastCalled(t, &mockClient.Mock, "UpdateUserData", 2) -} - -func AssertAtLeastCalled(t *testing.T, mock *mock.Mock, methodName string, minCalls int) { - callCount := 0 - for _, call := range mock.Calls { - if call.Method == methodName { - callCount++ - } - } - assert.GreaterOrEqual(t, callCount, minCalls, "Expected at least %d calls to %s, but got %d", minCalls, methodName, callCount) -} From 36b5fc46f0610c3ba8ae3af9b420a6b9dd20c62d Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 21:51:49 -0800 Subject: [PATCH 11/23] clean-ups --- internalsdk/pro/user_test.go | 87 ++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 internalsdk/pro/user_test.go diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go new file mode 100644 index 000000000..6d0cdf4d9 --- /dev/null +++ b/internalsdk/pro/user_test.go @@ -0,0 +1,87 @@ +package pro + +import ( + "context" + "testing" + "time" + + "github.com/getlantern/errors" + "github.com/getlantern/lantern-client/internalsdk/protos" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +// Define the mock proClient +type mockProClient struct { + mock.Mock +} + +func (m *mockProClient) UpdateUserData(ctx context.Context, session ClientSession) (*protos.User, error) { + args := m.Called(ctx, session) + user, _ := args.Get(0).(*protos.User) + return user, args.Error(1) +} + +// Test PollUserData +func TestPollUserData(t *testing.T) { + mockClient := new(mockProClient) + var session ClientSession + + mockClient.On("UpdateUserData", mock.Anything, session).Return(nil, nil) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + c := &proClient{ + backoffRunner: &backoffRunner{}, + } + + // Run PollUserData + go c.PollUserData(ctx, session, 10*time.Second, mockClient) + + time.Sleep(12 * time.Second) + + // Count the number of calls + callCount := 0 + for _, call := range mockClient.Calls { + if call.Method == "UpdateUserData" { + callCount++ + } + } + + // Verify the minimum number of calls + assert.GreaterOrEqual(t, callCount, 2, "Expected UpdateUserData to be called at least twice") +} + +// Test PollUserData Handles Errors +func TestPollUserDataWithError(t *testing.T) { + mockClient := new(mockProClient) + var session ClientSession + + // Configure the mock client to simulate errors + mockClient.On("UpdateUserData", mock.Anything, session).Return(nil, errors.New("mock error")) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + c := &proClient{ + backoffRunner: &backoffRunner{}, + } + + go c.PollUserData(ctx, session, 5*time.Second, mockClient) + + time.Sleep(6 * time.Second) + + // Verify that UpdateUserData was retried multiple times + AssertAtLeastCalled(t, &mockClient.Mock, "UpdateUserData", 2) +} + +func AssertAtLeastCalled(t *testing.T, mock *mock.Mock, methodName string, minCalls int) { + callCount := 0 + for _, call := range mock.Calls { + if call.Method == methodName { + callCount++ + } + } + assert.GreaterOrEqual(t, callCount, minCalls, "Expected at least %d calls to %s, but got %d", minCalls, methodName, callCount) +} From 77d916e9b0d40cb877a06bedde654f642a46c1d1 Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 21 Nov 2024 21:52:27 -0800 Subject: [PATCH 12/23] clean-ups --- internalsdk/pro/user_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internalsdk/pro/user_test.go b/internalsdk/pro/user_test.go index 6d0cdf4d9..1bde36591 100644 --- a/internalsdk/pro/user_test.go +++ b/internalsdk/pro/user_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/mock" ) -// Define the mock proClient type mockProClient struct { mock.Mock } @@ -53,7 +52,7 @@ func TestPollUserData(t *testing.T) { assert.GreaterOrEqual(t, callCount, 2, "Expected UpdateUserData to be called at least twice") } -// Test PollUserData Handles Errors +// Test PollUserData (Handles Errors) func TestPollUserDataWithError(t *testing.T) { mockClient := new(mockProClient) var session ClientSession From 5f07f098eb6070c7418282d8faae4340330c13ba Mon Sep 17 00:00:00 2001 From: atavism Date: Sun, 1 Dec 2024 06:07:36 -0800 Subject: [PATCH 13/23] update flashlight and run go mod tidy --- go.sum | 159 +-------------------------------------------------------- 1 file changed, 1 insertion(+), 158 deletions(-) diff --git a/go.sum b/go.sum index ea9dd5143..3ffe4a7d0 100644 --- a/go.sum +++ b/go.sum @@ -4,20 +4,15 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= crawshaw.io/sqlite v0.3.2/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= filippo.io/edwards25519 v1.0.0-rc.1.0.20210721174708-390f27c3be20/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.torproject.org/pluggable-transports/goptlib.git v1.0.0/go.mod h1:YT4XMSkuEXbtqlydr9+OxqFAyspUv0Gr9qhM3B++o/Q= -git.torproject.org/pluggable-transports/goptlib.git v1.2.0 h1:0qRF7Dw5qXd0FtZkjWUiAh5GTutRtDGL4GXUDJ4qMHs= git.torproject.org/pluggable-transports/goptlib.git v1.2.0/go.mod h1:4PBMl1dg7/3vMWSoWb46eGWlrxkUyn/CAJmxhDLAlDs= -github.com/1Password/srp v0.2.0 h1:PZKAafEyExnwevliL6d2+FDhJXZ0phxqiG2OeIaj9Xk= github.com/1Password/srp v0.2.0/go.mod h1:LIGqQ7eEA0UJT98j7sXk60QWVpHJ3g00BX6LOm9kYTc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Jigsaw-Code/outline-sdk v0.0.16 h1:WbHmv80FKDIpzEmR3GehTbq5CibYTLvcxIIpMMILiEs= github.com/Jigsaw-Code/outline-sdk v0.0.16/go.mod h1:e1oQZbSdLJBBuHgfeQsgEkvkuyIePPwstUeZRGq0KO8= -github.com/Jigsaw-Code/outline-ss-server v1.5.0 h1:Vz+iS0xR7i3PrLD82pzFFwZ9fsh6zrNawMeYERR8VTc= github.com/Jigsaw-Code/outline-ss-server v1.5.0/go.mod h1:KaebwBiCWDSkgsJrJIbGH0szON8CZq4LgQaFV8v3RM4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/OperatorFoundation/Replicant-go/Replicant/v3 v3.0.23 h1:g0kC1BDonLwNse78HRsudElKEDfXHusLQ9Nfekl/l0o= github.com/OperatorFoundation/Replicant-go/Replicant/v3 v3.0.23/go.mod h1:QVlygHzbNc/fX+OHurCRC0AFwISJAUQbPaqdEfAkUio= @@ -36,18 +31,14 @@ github.com/RoaringBitmap/roaring v1.9.4 h1:yhEIoH4YezLYT04s1nHehNO64EKFTop/wBhxv github.com/RoaringBitmap/roaring v1.9.4/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/Yawning/chacha20 v0.0.0-20170904085104-e3b1f968fc63 h1:I6/SJSN9wJMJ+ZyQaCHUlzoTA4ypU5Bb44YWR1wTY/0= github.com/Yawning/chacha20 v0.0.0-20170904085104-e3b1f968fc63/go.mod h1:nf+Komq6fVP4SwmKEaVGxHTyQGKREVlwjQKpvOV39yE= github.com/aead/ecdh v0.2.0 h1:pYop54xVaq/CEREFEcukHRZfTdjiWvYIsZDXXrBapQQ= github.com/aead/ecdh v0.2.0/go.mod h1:a9HHtXuSo8J1Js1MwLQx2mBhkXMT6YwUmVVEY4tTB8U= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k= -github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8= github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -76,7 +67,6 @@ github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+ github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 h1:9o/yVzzLzYaBDFx8B27yhkvBLhNnRAuSTK7Y+yZKVtU= github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83/go.mod h1:xvHjsYWWP7yO8PZwtuIp/k0DBlu07pSJqH4SEC78Vwc= -github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62 h1:P04VG6Td13FHMgS5ZBcJX23NPC/fiC4cp9bXwYujdYM= github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62/go.mod h1:66cFKPCO7Sl4vbFnAaSq7e4OXtdMhRSBagJGWgmpJbM= github.com/anacrolix/missinggo v0.0.0-20180725070939-60ef2fbf63df/go.mod h1:kwGiTUTZ0+p4vAz3VbAI5a30t2YbvemcmspjKwrAz5s= github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= @@ -153,7 +143,6 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo= github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= @@ -167,14 +156,11 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= -github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/dsoprea/go-exif/v2 v2.0.0-20200321225314-640175a69fe4/go.mod h1:Lm2lMM2zx8p4a34ZemkaUV95AnMl4ZvLbCUbwOvLC2E= @@ -221,7 +207,6 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.3-0.20170329110642-4da3e2cfbabc/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/garyburd/redigo v1.1.1-0.20170914051019-70e1b1943d4f/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= @@ -230,16 +215,13 @@ github.com/gaukas/wazerofs v0.1.0 h1:wIkW1bAxSnpaaVkQ5LOb1tm1BXdVap3eKjJpVWIqt2E github.com/gaukas/wazerofs v0.1.0/go.mod h1:+JECB9Fwt0taPqSgHckG9lmT3tcoVK+9VJozTsq9UlI= github.com/getlantern/algeneva v0.0.0-20240605225338-caba0b3edf03 h1:VaBQdRGkP47xBr8OIAkQFt52KLXMZQhbYrwZiOK7rPw= github.com/getlantern/algeneva v0.0.0-20240605225338-caba0b3edf03/go.mod h1:PrNR8tMXO26YNs8K9653XCUH7u2Kv4OdfFC3Ke1GsX0= -github.com/getlantern/appdir v0.0.0-20200615192800-a0ef1968f4da h1:T/pxF37Z9SIQCHhMMUITZ3rhKRL0Noi9XxNwxKdBNw0= github.com/getlantern/appdir v0.0.0-20200615192800-a0ef1968f4da/go.mod h1:3vR6+jQdWfWojZ77w+htCqEF5MO/Y2twJOpAvFuM9po= -github.com/getlantern/autoupdate v0.0.0-20240926204302-11d9aa2df948 h1:QPpGiY3ljAaNe3qdx22cTVzDPQLS/4yUeuvyGgfADCA= github.com/getlantern/autoupdate v0.0.0-20240926204302-11d9aa2df948/go.mod h1:ohIVs2H6Wb58ZaCw/OAP+z6RPFVaRokAnldy+ATGwdQ= github.com/getlantern/broflake v0.0.0-20241127130800-763b7ebbf090 h1:amN67m7WRx4oz3Si4VpX3p5rgWdPqYZ7TOW8v1n3PYk= github.com/getlantern/broflake v0.0.0-20241127130800-763b7ebbf090/go.mod h1:iH3x6VHpNclNAY8Nuuhp+8/b2Lv4ng33lSt7DuNH/4E= github.com/getlantern/bufconn v0.0.0-20190625204133-a08544339f8d/go.mod h1:d6O4RY+V87kIt4o9wru4SaNo7C2NAkD3YnmJFXEpODo= github.com/getlantern/bufconn v0.0.0-20210901195825-fd7c0267b493 h1:8WjDNmpDLFVsAfcnHxqF4pfVKkdAQxyJ9iCHB4LxSfc= github.com/getlantern/bufconn v0.0.0-20210901195825-fd7c0267b493/go.mod h1:d6O4RY+V87kIt4o9wru4SaNo7C2NAkD3YnmJFXEpODo= -github.com/getlantern/bytecounting v0.0.0-20190530140808-3b3f10d3b9ab h1:bKsTXN1XgjiWuciuEChVIPFXWD8sTASsvjkMAGMEb/4= github.com/getlantern/bytecounting v0.0.0-20190530140808-3b3f10d3b9ab/go.mod h1:O/UvKlcgUd/tsplTbFesvYtqGENHVE/yO8DJ1sd+x+g= github.com/getlantern/byteexec v0.0.0-20170405023437-4cfb26ec74f4/go.mod h1:4WCQkaCIwta0KlF9bQZA1jYqp8bzIS2PeCqjnef8nZ8= github.com/getlantern/byteexec v0.0.0-20220903142956-e6ed20032cfd h1:0xt9OTbV50a/+ZarMcr86ybWiN1v+bbwzdnVuXHzR/o= @@ -260,7 +242,6 @@ github.com/getlantern/detour v0.0.0-20230503144615-d3106a68f79e h1:ah9RgyL8S76l/ github.com/getlantern/detour v0.0.0-20230503144615-d3106a68f79e/go.mod h1:BndJgV9V8+iLA35NIVqk7u0VTLUGgkc1jmVI+gWJAtI= github.com/getlantern/dhtup v0.0.0-20240217002836-8587da02c55c h1:pP2e2eiTLoHQBJGl1N/VyBfkQ/+Lag1O/h2VkitZwXM= github.com/getlantern/dhtup v0.0.0-20240217002836-8587da02c55c/go.mod h1:XJZGC2a7v4I+0IzQdwsLYiqRtEh3jgtdp/l+PmNQkWQ= -github.com/getlantern/diagnostics v0.0.0-20230503185158-c2fc28ed22fe h1:Uk3e38UmJhjM+ypM6O38cIYac2yZMhoDocaEm9U7qJE= github.com/getlantern/diagnostics v0.0.0-20230503185158-c2fc28ed22fe/go.mod h1:B82GdSnu6Ex9Ir1PaChox3TirdZbVt4Zad3Al/YtdgE= github.com/getlantern/dns v0.0.0-20240124035051-0d45dd3cfe54 h1:BKBCh+EwJiowxU1+CMa8fIQbD1kQLVhxes6GKu56R6U= github.com/getlantern/dns v0.0.0-20240124035051-0d45dd3cfe54/go.mod h1:zaFhzOF3ndksog07db0DZNIzTVeuAirjwWeuam1Azo8= @@ -273,7 +254,6 @@ github.com/getlantern/elevate v0.0.0-20220903142053-479ab992b264 h1:q50MSzoIIKot github.com/getlantern/elevate v0.0.0-20220903142053-479ab992b264/go.mod h1:2VB8zy/kMNX347i5fdusJbPNAZE26u8qoHJDy7CWP9A= github.com/getlantern/ema v0.0.0-20190620044903-5943d28f40e4 h1:PMK8QQn9GLTQXdHnqoNhyToOa8snagaZVt9Xb36NEUc= github.com/getlantern/ema v0.0.0-20190620044903-5943d28f40e4/go.mod h1:tzRwT19aDrWSr6yRDs8iOvaXXCau96EgWsgGT9wIpoQ= -github.com/getlantern/enhttp v0.0.0-20210901195634-6f89d45ee033 h1:HbjEpFFiRYcySVkFMdn3kl3OUU0UZwMdcXzY5gXUEQo= github.com/getlantern/enhttp v0.0.0-20210901195634-6f89d45ee033/go.mod h1:kHP/nfmHj9HJVN5Cb+1RFNRLR0O0nx40YENc4wKIe6s= github.com/getlantern/errors v0.0.0-20190325191628-abdb3e3e36f7/go.mod h1:l+xpFBrCtDLpK9qNjxs+cHU6+BAdlBaxHqikB6Lku3A= github.com/getlantern/errors v1.0.1/go.mod h1:l+xpFBrCtDLpK9qNjxs+cHU6+BAdlBaxHqikB6Lku3A= @@ -293,19 +273,15 @@ github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731/go.mod h1:XZwE+ github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtAkb1OuOLBct/uFfL1p3XxAIcFct82GbT+UZM= github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= -github.com/getlantern/flashlight/v7 v7.6.147 h1:sF5wftnezW3kg3vn2dLpNDTHc25BhrwnHJox2zZChHo= +github.com/getlantern/flashlight/v7 v7.6.147 h1:bL20KaA+UkPzYI9uXMDJHf+gSpHJbVBV9f/8+/EwFHI= github.com/getlantern/flashlight/v7 v7.6.147/go.mod h1:sLQXxC8MW4gqHXFjINLxbbz1GOPEf6Hwvs30gdVsAk8= -github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw= github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI= github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2 h1:h3TZ7ye/1fqOLqfwTho4iRSEQqTMKVJIsOF+5XNyhus= github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2/go.mod h1:NfZDG8pmTL3wvo/s/sflpJFsgIL7etelgwzDRtO4HIM= -github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9 h1:mSg57/+t59Q08AqArlhW+3N1AVPn5ox0dTOYonRps6w= github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9/go.mod h1:RjQ0krF8NTCc5xo2Q1995/vZBnYg33h8svn15do7dLg= github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5 h1:RBKofGGMt2k6eGBwX8mky9qunjL+KnAp9JdzXjiRkRw= github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5/go.mod h1:kGHRXch95rnGLHjER/GhhFiHvfnqNz7KqWD9kGfATHY= -github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93 h1:CFLw2b6vgOmpxsRWRiTd46tiR6YKg2crIuTu4cINYcY= github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93/go.mod h1:wgB2BFT8ZaPKyKOQ/5dljMG/YIow+AIXyq4KBwJ5sGQ= -github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc h1:qZ/HlURAOgGRKtqDGimPwL2w5PkvW7Ap+c1bGRK0pzU= github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc/go.mod h1:DQAFBxfQlSru9Loud3pLM+rF//qf0FQBtB//grF89IA= github.com/getlantern/golog v0.0.0-20190809085441-26e09e6dd330/go.mod h1:zx/1xUUeYPy3Pcmet8OSXLbF47l+3y6hIPpyLWoR9oc= github.com/getlantern/golog v0.0.0-20190830074920-4ef2e798c2d7/go.mod h1:zx/1xUUeYPy3Pcmet8OSXLbF47l+3y6hIPpyLWoR9oc= @@ -314,13 +290,10 @@ github.com/getlantern/golog v0.0.0-20201105130739-9586b8bde3a9/go.mod h1:ZyIjgH/ github.com/getlantern/golog v0.0.0-20210606115803-bce9f9fe5a5f/go.mod h1:ZyIjgH/1wTCl+B+7yH1DqrWp6MPJqESmwmEQ89ZfhvA= github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65 h1:NlQedYmPI3pRAXJb+hLVVDGqfvvXGRPV8vp7XOjKAZ0= github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65/go.mod h1:+ZU1h+iOVqWReBpky6d5Y2WL0sF2Llxu+QcxJFs2+OU= -github.com/getlantern/gonat v0.0.0-20201001145726-634575ba87fb h1:tDQA66mL1vTHKSMu3Ras/9Tk884ipPAhcdQHXpnDhxg= github.com/getlantern/gonat v0.0.0-20201001145726-634575ba87fb/go.mod h1:ysiamkJHyOrnlNmtDCCccH1NbFdgEBSJRg44DWiOxcY= github.com/getlantern/gotun v0.0.0-20190809092752-6d35bb1397ee/go.mod h1:zvsZQrsl7Yrmi+ENk5WZFT7dQaYtihAcI0H/9+LacqQ= -github.com/getlantern/gowin v0.0.0-20160824205538-88fa116ddffc h1:4PgzRiHOP7qfq6kBzcj7dSbE6QmAoD5P87+rJvOH0Gs= github.com/getlantern/gowin v0.0.0-20160824205538-88fa116ddffc/go.mod h1:UX71eBZilSY+UR7rfdMh0rA/IY0HS7tXRoMO9EiKXKE= github.com/getlantern/grtrack v0.0.0-20160824195228-cbf67d3fa0fd/go.mod h1:RkQEgBdrJCH5tYJP2D+a/aJ216V3c9q8w/tCJtEiDoY= -github.com/getlantern/grtrack v0.0.0-20231025115619-bfbfadb228f3 h1:3eOqQA2WKd5tvepSwHXcN1IteDBnWcrs4dAoKVpGZ9k= github.com/getlantern/grtrack v0.0.0-20231025115619-bfbfadb228f3/go.mod h1:esUcij+yiXH9mSlzZChtoSClQ9vr8cjNgEbcDHVqJfI= github.com/getlantern/hellosplitter v0.1.1 h1:eV01w6T9Ca7wjctte71hNBST+lsbSGKf82yxSed3XJ4= github.com/getlantern/hellosplitter v0.1.1/go.mod h1:8TgRrwnkkz8PNiqMQVOorGtmIBXBSj7YrRCuDP8NXLg= @@ -330,17 +303,14 @@ github.com/getlantern/hex v0.0.0-20220104173244-ad7e4b9194dc/go.mod h1:D9RWpXy/E github.com/getlantern/hidden v0.0.0-20190325191715-f02dbb02be55/go.mod h1:6mmzY2kW1TOOrVy+r41Za2MxXM+hhqTtY3oBKd2AgFA= github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770 h1:cSrD9ryDfTV2yaur9Qk3rHYD414j3Q1rl7+L0AylxrE= github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770/go.mod h1:GOQsoDnEHl6ZmNIL+5uVo+JWRFWozMEp18Izcb++H+A= -github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e h1:qNYdR1Zb/HrE9QxOWkktuS4cG2TRjuoO/ssLDFR1rPE= github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e/go.mod h1:gdTIGBw1dSTKkQV+3XHI27R++69ENeWPiWSnq3zLF8g= github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca h1:Of3VwFEfKbVnK5/VGy05XUbi6QvTs5Y2eLDfPv3O50E= github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca/go.mod h1:TNC/xJFmctsSGyXqcnVWwCRCPD/4zGQP7yBVnLDRa/U= -github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c h1:+JnT+Rwa/3rksc4Zi0u6fJ/WX+tPK58GtsrcXWVUU2U= github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c/go.mod h1:6yS3MFZmWDK0zxWXX0619QzZpqmCaHJ8P83Ee4QcTq0= github.com/getlantern/idletiming v0.0.0-20190529182719-d2fbc83372a5/go.mod h1:MGP8kEgZGgAhvHISt0hJGQgxg/VAqGdw3+kSZBnfC/4= github.com/getlantern/idletiming v0.0.0-20200228204104-10036786eac5/go.mod h1:McaLC6faRlxJ9QjjqSjpEeYIjKnKA8+dzjoR+eYXCio= github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db h1:w/Br8vclvX3RlHV+VFkuNkcm3hwEXTtqXMoOqKPUicg= github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db/go.mod h1:kW4RHAFReMopujQCzcYxjOAg4XZOeuSrybIcM9FNGto= -github.com/getlantern/ipproxy v0.0.0-20240923151842-ff95aca6e3dc h1:6yCC6u18l/RcxiEZsJaV6BxTBSRDA4TdtHayRpGJMKQ= github.com/getlantern/ipproxy v0.0.0-20240923151842-ff95aca6e3dc/go.mod h1:rkY8JPMJmzi29/uTE6o/6BbtOjt1lcMsrI+QwZK4MU8= github.com/getlantern/iptool v0.0.0-20210721034953-519bf8ce0147/go.mod h1:hfspzdRcvJ130tpTPL53/L92gG0pFtvQ6ln35ppwhHE= github.com/getlantern/iptool v0.0.0-20230112135223-c00e863b2696 h1:D7wbL2Ww6QN5SblEDMiQcFulqz2jgcvawKaNBTzHLvQ= @@ -351,27 +321,22 @@ github.com/getlantern/kcp-go/v5 v5.0.0-20220503142114-f0c1cd6e1b54 h1:JqIiaDpL6C github.com/getlantern/kcp-go/v5 v5.0.0-20220503142114-f0c1cd6e1b54/go.mod h1:KFBWdR0PdEQK0JtGcE1lhAoYFVTRxWDFfYBARPb0t9Q= github.com/getlantern/kcpwrapper v0.0.0-20230327091313-c12d7c17c6de h1:RS4Tx7aVExrAXsgvrXSln9iQ5HZNPpvHjJGM/MQH8ZE= github.com/getlantern/kcpwrapper v0.0.0-20230327091313-c12d7c17c6de/go.mod h1:UVPVk1fNbqBceE4i+x/qbNxUNQ7gMACdOukoIbXM9jc= -github.com/getlantern/keepcurrent v0.0.0-20221014183517-fcee77376b89 h1:gjlTAADW8ZUrIey+u1ZtbVlI91bqI0Bu+GBxvRlBBqo= github.com/getlantern/keepcurrent v0.0.0-20221014183517-fcee77376b89/go.mod h1:EtJEobtQH/HiQsZLyRjlrnq/fu7vfgnTMzhbmUqkZ3M= github.com/getlantern/keyman v0.0.0-20180207174507-f55e7280e93a/go.mod h1:FMf0g72BHs14jVcD8i8ubEk4sMB6JdidBn67d44i3ws= github.com/getlantern/keyman v0.0.0-20200819205636-76fef27c39f1/go.mod h1:FMf0g72BHs14jVcD8i8ubEk4sMB6JdidBn67d44i3ws= github.com/getlantern/keyman v0.0.0-20230503155501-4e864ca2175b h1:iyEuk8ARQC9HfraqC4r3leBhU55R1TV7bAiyPYE54kA= github.com/getlantern/keyman v0.0.0-20230503155501-4e864ca2175b/go.mod h1:ZJ+yDaZkJ/JU9j7EQa3UUh6ouedrNDDLA5OiowS1Iuk= -github.com/getlantern/lampshade v0.0.0-20201109225444-b06082e15f3a h1:z7G1v79GB1qRrkcbzF0nrLzV/+dwdGmamEZAp0ff+z0= github.com/getlantern/lampshade v0.0.0-20201109225444-b06082e15f3a/go.mod h1:cGOfTjvllC9bcwS7cVW6tGT6fXc8Dki384uFjm7XBnw= github.com/getlantern/lantern-algeneva v0.0.0-20240930181006-6d3c00db1d5d h1:ACBwPR4du54Qw+X5ajsbMqOFR8euGZRdMGkvTDS7I60= github.com/getlantern/lantern-algeneva v0.0.0-20240930181006-6d3c00db1d5d/go.mod h1:bDcK4RWBjBO+bBPLTCmaEyYK+n0/w0TrzvSCJOQmkgk= -github.com/getlantern/launcher v0.0.0-20230622120034-fe87f9bff286 h1:b8XesQLtoq58M8FcYxxfWDUcBOzbGfBJGDOZDQ4PjYs= github.com/getlantern/launcher v0.0.0-20230622120034-fe87f9bff286/go.mod h1:pEDM+G+PFz616x02zkWcmhjaeZ9rHDKZL8stK3uE9J8= github.com/getlantern/mandrill v0.0.0-20221004112352-e7c04248adcb h1:oyEMOT9jn4bzKyivF2sVBogsXyL8fBCK7HIT/P6h64Y= github.com/getlantern/mandrill v0.0.0-20221004112352-e7c04248adcb/go.mod h1:gz4iIB+vPk8hWxkAnnZSudQuIpBMnW7i89eHl9Fl+I8= -github.com/getlantern/measured v0.0.0-20230919230611-3d9e3776a6cd h1:pDfqh9yd58OW9vQzv4U+q6G+LfbNXVhbWcBWmC5Dkm4= github.com/getlantern/measured v0.0.0-20230919230611-3d9e3776a6cd/go.mod h1:QG6d9+nAxD1PjVjgGLUUHPZBQUp20/h7j8a3kxd/8Rc= github.com/getlantern/meta-scrubber v0.0.1 h1:WknyffbSpb5kEwDQ6lrN9+KohCGnqhs5zQfGk4sFRGo= github.com/getlantern/meta-scrubber v0.0.1/go.mod h1:nYmOMQXbex3emWMNbt/iDKTXE1q53x1dDxCspxjwxyY= github.com/getlantern/mockconn v0.0.0-20190708122800-637bd46d8034/go.mod h1:+F5GJ7qGpQ03DBtcOEyQpM30ix4BLswdaojecFtsdy8= github.com/getlantern/mockconn v0.0.0-20191023022503-481dbcceeb58/go.mod h1:+F5GJ7qGpQ03DBtcOEyQpM30ix4BLswdaojecFtsdy8= -github.com/getlantern/mockconn v0.0.0-20200818071412-cb30d065a848 h1:2MhMMVBTnaHrst6HyWFDhwQCaJ05PZuOv1bE2gN8WFY= github.com/getlantern/mockconn v0.0.0-20200818071412-cb30d065a848/go.mod h1:+F5GJ7qGpQ03DBtcOEyQpM30ix4BLswdaojecFtsdy8= github.com/getlantern/mtime v0.0.0-20170117193331-ba114e4a82b0/go.mod h1:u537FS7ld4Whf7h7/0ql/myAudWWBNgeRhgE9XXH4Pk= github.com/getlantern/mtime v0.0.0-20200228202836-084e1d8282b0/go.mod h1:GfzwugvtH7YcmNIrHHizeyImsgEdyL88YkdnK28B14c= @@ -379,13 +344,11 @@ github.com/getlantern/mtime v0.0.0-20200417132445-23682092d1f7 h1:03J6Cb42EG06lH github.com/getlantern/mtime v0.0.0-20200417132445-23682092d1f7/go.mod h1:GfzwugvtH7YcmNIrHHizeyImsgEdyL88YkdnK28B14c= github.com/getlantern/multipath v0.0.0-20230510135141-717ed305ef50 h1:+3K4Zk0NuXGHdPOL6uqchUUFyLUIl0CIdlp6ksgZxDM= github.com/getlantern/multipath v0.0.0-20230510135141-717ed305ef50/go.mod h1:uzxEbpNdIj+Iw9lEVuY1HF3OdAJ4RJykQHSL8lPee4M= -github.com/getlantern/nettest v1.0.0 h1:xg8vq9JrGzrFGFkFGwZwIJ5+kwtvyqNDIADwrANvhQg= github.com/getlantern/nettest v1.0.0/go.mod h1:8wY0QwrdpkayCBQXjhZoJuwu2IHfp4UErrxgwaJ2UM4= github.com/getlantern/netx v0.0.0-20190110220209-9912de6f94fd/go.mod h1:wKdY0ikOgzrWSeB9UyBVKPRhjXQ+vTb+BPeJuypUuNE= github.com/getlantern/netx v0.0.0-20211206143627-7ccfeb739cbd/go.mod h1:WEXF4pfIfnHBUAKwLa4DW7kcEINtG6wjUkbL2btwXZQ= github.com/getlantern/netx v0.0.0-20240830183145-c257516187f0 h1:1K7Rbp2V/XGlZohPRz4IncT6C5RTiSGI2IB9YF34pbI= github.com/getlantern/netx v0.0.0-20240830183145-c257516187f0/go.mod h1:JbzAvxJWngaUtz5QqKz9w6zHU0Efw21cuY0aNN209Kc= -github.com/getlantern/notifier v0.0.0-20240830181717-11f4c6c3fa95 h1:vrS7lr+avjlKMoyVS1oW3Fmj6Yr0IgyzmsPGvCQG7Xk= github.com/getlantern/notifier v0.0.0-20240830181717-11f4c6c3fa95/go.mod h1:McPrM/v48T21UaFItGjKB5bojFHIel9mKvtRMOjlXyo= github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA= github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA= @@ -393,19 +356,12 @@ github.com/getlantern/ops v0.0.0-20231025133620-f368ab734534 h1:3BwvWj0JZzFEvNNi github.com/getlantern/ops v0.0.0-20231025133620-f368ab734534/go.mod h1:ZsLfOY6gKQOTyEcPYNA9ws5/XHZQFroxqCOhHjGcs9Y= github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175 h1:JWH5BB2o0eAeGs0tZnFPpQGx+nMIo/WmxKnj2hnGjgE= github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175/go.mod h1:h3S9LBmmzN/xM+lwYZHE4abzTtCTtidKtG+nxZcCZX0= -github.com/getlantern/packetforward v0.0.0-20201001150407-c68a447b0360 h1:pijUoofaQcAM/8zbDzZM2LQ90kGVbKfnSAkFnQwLZZU= github.com/getlantern/packetforward v0.0.0-20201001150407-c68a447b0360/go.mod h1:nsJPNYUSY96xB+p7uiDW8O4uiKea+KjeUdS5d6tf9IU= -github.com/getlantern/pathdb v0.0.0-20231026090702-54ee1ddd99eb h1:rbkflUPjr83ON7c+4LqU2Y/rJzv9P/fmocXDLLm0hWQ= github.com/getlantern/pathdb v0.0.0-20231026090702-54ee1ddd99eb/go.mod h1:SFQy+f58IbLpnbq2nVqlq7ccwaUiO7ablKv631WVIuc= github.com/getlantern/preconn v1.0.0 h1:DsY3l/y/BJUj86WyaxXylbJnCC9QbKcc3D6js6rFL60= github.com/getlantern/preconn v1.0.0/go.mod h1:i/AnXvx715Fq7HgZLlmQlw3sGfEkku8BQT5hLHMK4+k= github.com/getlantern/probe v0.0.0-20191107230642-ed284e08029a/go.mod h1:EPE0nd9YNS2FTIz+2EOkqojCuqaQlJ+fTiLPklsqe/E= -github.com/getlantern/probe v0.0.0-20211216020459-69afa01c1c5c h1:bWusw8SYvl/iq+nHzSIe4oC7HdwaCN0KQEZkIHimamM= -github.com/getlantern/probe v0.0.0-20211216020459-69afa01c1c5c/go.mod h1:ditYj5obTW66F7c2nOTFUONMADmbzkzOsnkWfFWH3jk= github.com/getlantern/probednet v0.0.0-20190725133252-1cfdb2354b4d/go.mod h1:7sl7hPjPDAqXyxVx7mhrKfvb4oCX/ROhcs16w2EhWX8= -github.com/getlantern/probednet v0.0.0-20211216020507-22fd9c1d3bf6 h1:8jg6OehdQr90Ybmyc68raXEqM/1hk8E7F2YAUfmcvzE= -github.com/getlantern/probednet v0.0.0-20211216020507-22fd9c1d3bf6/go.mod h1:noglym51kFdkZEV/WjiIzRKV6qwwTI9/vSAjeOI/zCU= -github.com/getlantern/profiling v0.0.0-20160317154340-2a15afbadcff h1:q5GcvgoGNRJ5yVCr5p0vUcXyYOGvTb+Lq/g4TW2HbfA= github.com/getlantern/profiling v0.0.0-20160317154340-2a15afbadcff/go.mod h1:eHf4vTrd0oaXLtbz+zM28cfsX4ylva7hbM2zt4+axZo= github.com/getlantern/proxy/v3 v3.0.0-20240328103708-9185589b6a99 h1:kyd1bT1H7CXasGVLfY4sai9cpDaZ12Ed7Qi7yIeumqw= github.com/getlantern/proxy/v3 v3.0.0-20240328103708-9185589b6a99/go.mod h1:I5SvkXI843L2Hvsi0TG8H1jCXtaApOemBZZD1/N0Inw= @@ -414,7 +370,6 @@ github.com/getlantern/psmux v1.5.15 h1:VUCEk8MIsvAj90wNYRyY2fE9ZL4LIRhi1W5V9aycA github.com/getlantern/psmux v1.5.15/go.mod h1:nyp/sr4uTbWpUh7Q2WovRb07LeLNUxDg8kAdS726FIw= github.com/getlantern/quicwrapper v0.0.0-20240229232335-e6b4c3c30b2f h1:w/PNBtsqHpq7df3CYl1Pq55ktQto8Eb55IfMG0a37XU= github.com/getlantern/quicwrapper v0.0.0-20240229232335-e6b4c3c30b2f/go.mod h1:V1d6sFYfulYYs07QS2pzBkpuQiF2Jj12KepiT3LFytY= -github.com/getlantern/ratelimit v0.0.0-20220926192648-933ab81a6fc7 h1:47FJ5kTeXc3I1VPpi2hWW9I16/Y3K0cpUq/B7oWJGF8= github.com/getlantern/ratelimit v0.0.0-20220926192648-933ab81a6fc7/go.mod h1:OOqKCIkspqXtIWEex4uhH1H9l7NGekT9i3Hs591ZDk4= github.com/getlantern/replica v0.14.5-0.20240909174421-21691d4b40f8 h1:K+zi+42bkdPfyE9ZoGpDWocUzLfIGajmHTIvbippeX8= github.com/getlantern/replica v0.14.5-0.20240909174421-21691d4b40f8/go.mod h1:EGZQzNcxXFE6/C4hM6+91fDZz9hOQ0GZHdzNne3k/Oc= @@ -422,21 +377,16 @@ github.com/getlantern/rot13 v0.0.0-20220822172233-370767b2f782 h1:A1+qM0Dqm0no8A github.com/getlantern/rot13 v0.0.0-20220822172233-370767b2f782/go.mod h1:O0dNqH9hbXlOa9OpVdbACmTBfDPD+ENjbY0cPkzBd9g= github.com/getlantern/rotator v0.0.0-20160829164113-013d4f8e36a2 h1:smFR/kESUKlcdyatoOO3HngBzzrUU6S0LRw2vCBYQPg= github.com/getlantern/rotator v0.0.0-20160829164113-013d4f8e36a2/go.mod h1:Ap+QTDJeA24+0jjPHReq/LyP3ugEEDYvncluEgsm60A= -github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627 h1:eYXtxjRyiP9f1rMvbnyT4DBWFEiIPY3zzMA5KqVshyc= github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627/go.mod h1:QJUudepmTj/KQXnReV6DZSJY/xO05fnfcZf3t8zkNLg= github.com/getlantern/shortcut v0.0.0-20211026183428-bf59a137fdec h1:8TfjIMydnhBs4edmXu2Nz1f2P0QOcXfol2rR1cxfrSs= github.com/getlantern/shortcut v0.0.0-20211026183428-bf59a137fdec/go.mod h1:3VQ6qvEBehqDBNbEKfNtSjK6MR5ydOdjMPgKjKay7vo= -github.com/getlantern/sysproxy v0.0.0-20240711003440-384834c7b4cb h1:9eaFCu1MZ5yp1vpg6KNOkjTzQnfo2MAbgqOqL/AnmAw= github.com/getlantern/sysproxy v0.0.0-20240711003440-384834c7b4cb/go.mod h1:sIaf1EQGv8d+l71iPiFYiLJtBp9fRy5wgO3mTFXSPzM= -github.com/getlantern/telemetry v0.0.0-20230523155019-be7c1d8cd8cb h1:6XZ3Q4oD6A1Tjq6QLgzzQrdQ8FvulzW16HhNQOSECAM= github.com/getlantern/telemetry v0.0.0-20230523155019-be7c1d8cd8cb/go.mod h1:nGOdDc0aD/LRTaY2SGKQ7nsYcWFXrhgkrhIhJuYN614= -github.com/getlantern/testify v0.0.0-20160317154340-2eeb3906e78f h1:R6iv+VzCrbxlBm2TcgyJi9c7tQguNXi9JmIvuUJKrdc= github.com/getlantern/testify v0.0.0-20160317154340-2eeb3906e78f/go.mod h1:uKKI9HSwZ4C8tx1vV+ovbG32Lw9LixtzPLNiS8U/ddA= github.com/getlantern/timezone v0.0.0-20210901200113-3f9de9d360c9 h1:VTNjZxSuAHUzu13lYpEVB8gc3xz5hZePGNHG5enHYLY= github.com/getlantern/timezone v0.0.0-20210901200113-3f9de9d360c9/go.mod h1:7uvbzuoOr3uYGHZx5QWlI8/C52XEf/aTb/tJFEe41Ak= github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461 h1:3HOWV/uUGde6whvG7aoxIQlL43jHkmPupJsDCA569u0= github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461/go.mod h1:ZLyPOKtNWU4vWnAiRiNQ7hbfLMqCEuj1DgQWBtHp7tQ= -github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4 h1:73U3J4msGw3cXeKtCEbY7hbOdD6aX8gJv8BOu+VagF8= github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4/go.mod h1:f8WmDYKFOaC5/y0d3GWl6UKf1ZbSlIoMzkuC8x7pUhg= github.com/getlantern/tlsdialer/v3 v3.0.3 h1:OXzzAqO8YojBOu2Kk8wquX2zbFmgJjji41RpaT6knLg= github.com/getlantern/tlsdialer/v3 v3.0.3/go.mod h1:hwA0X81pnrgx7GEwddaGWSxqr6eLBm7A0rrUMK2J7KY= @@ -448,13 +398,9 @@ github.com/getlantern/tlsutil v0.2.0/go.mod h1:Vxsyr9DVnYwsqHaEzMYkg9fT8aBrnO2eI github.com/getlantern/tlsutil v0.5.3 h1:g1FjuG4/OTZe8kkbEmpSxvT9rXzYOG9jO4jHiDeQIxM= github.com/getlantern/tlsutil v0.5.3/go.mod h1:lVgvr4nxuQ1ocOho90UB6LnHFlpP16TXAGpHR8Z0QnI= github.com/getlantern/uuid v1.1.2-0.20190507182000-5c9436b8c718/go.mod h1:uX10hOzZUUDR+oYNSIks+RcozOEiwTNC/K2rw9SUi1k= -github.com/getlantern/uuid v1.2.0 h1:pGrGaCV7XEaG6lvjWkwf8Y92BjB/9yFmkKsNFpRQ7rc= github.com/getlantern/uuid v1.2.0/go.mod h1:uX10hOzZUUDR+oYNSIks+RcozOEiwTNC/K2rw9SUi1k= -github.com/getlantern/waitforserver v1.0.1 h1:xBjqJ3GgEk9JMWnDgRSiNHXINi6Lv2tGNjJR0hCkHFY= github.com/getlantern/waitforserver v1.0.1/go.mod h1:K1oSA8lNKgQ9iC00OFpMfMNm4UMrsxoGCdHf0NT9LGs= -github.com/getlantern/winsvc v0.0.0-20160824205134-8bb3a5dbcc1d h1:ptkLncSALmQuD24bNB6TIBvWQ2q1XpUs0HzqE9f+RJs= github.com/getlantern/winsvc v0.0.0-20160824205134-8bb3a5dbcc1d/go.mod h1:bbt0iMT4LOQxNCEtmxJmPtNZk+mRp0CXkqK9kab/0r4= -github.com/getlantern/withtimeout v0.0.0-20160829163843-511f017cd913 h1:YK3YNyTsa+1BPWOoN0F79rrjHyfNx4MAoFEvzwQU+dY= github.com/getlantern/withtimeout v0.0.0-20160829163843-511f017cd913/go.mod h1:bwttrA0oacoHdL476F60prypY1oC++WLtVexumgZozY= github.com/getlantern/yaml v0.0.0-20190801163808-0c9bb1ebf426 h1:lb2OElfhZzfgvNQym79ONvv4yvDh/gShHkLQI6qzriA= github.com/getlantern/yaml v0.0.0-20190801163808-0c9bb1ebf426/go.mod h1:SoTXbOvaDC1bH3QrlkU5kz/h12tU/hN54wSMUCdgEXs= @@ -485,11 +431,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw= github.com/go-ping/ping v1.1.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= github.com/go-stack/stack v1.6.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -497,8 +440,6 @@ github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= -github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -513,7 +454,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20170918230701-e5d664eb928e/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -527,7 +467,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -551,8 +490,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= -github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= -github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -564,7 +501,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190309154008-847fc94819f9/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -585,8 +521,6 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -596,28 +530,20 @@ github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jackpal/gateway v1.0.13 h1:fJccMvawxx0k7S1q7Fy/SXFE0R3hMXkMuw8y9SofWAk= github.com/jackpal/gateway v1.0.13/go.mod h1:6c8LjW+FVESFmwxaXySkt7fU98Yv806ADS3OY6Cvh2U= github.com/jaffee/commandeer v0.6.0 h1:YI44XLWcJN21euhh32sZW8vM/tljPYxhsXIfEPkQKcs= github.com/jaffee/commandeer v0.6.0/go.mod h1:kCwfuSvZ2T0NVEr3LDSo6fDUgi0xSBnAVDdkOKTtpLQ= github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= -github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4 h1:nwOc1YaOrYJ37sEBrtWZrdqzK22hiJs3GpDmP3sR2Yw= github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kataras/golog v0.1.9 h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk= -github.com/kataras/golog v0.1.9/go.mod h1:jlpk/bOaYCyqDqH18pgDHdaJab72yBE6i0O3s30hpWY= -github.com/kataras/pio v0.0.12 h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w= -github.com/kataras/pio v0.0.12/go.mod h1:ODK/8XBhhQ5WqrAhKy+9lTPS7sBf6O3KcLhc9klfRcY= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -629,12 +555,10 @@ github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ib github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.12.3 h1:tzUznbfc3OFwJaTebv/QdhnFf2Xvb7gZ24XaHLBPmdc= github.com/klauspost/reedsolomon v1.12.3/go.mod h1:3K5rXwABAvzGeR01r6pWZieUALXO/Tq7bFKGIb4m4WI= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/binarydist v0.1.0 h1:6kAoLA9FMMnNGSehX0s1PdjbEaACznAv/W219j2uvyo= github.com/kr/binarydist v0.1.0/go.mod h1:DY7S//GCoz1BCd0B0EVrinCKAZN3pXe+MDaIZbXQVgM= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -646,10 +570,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leekchan/accounting v1.0.0 h1:+Wd7dJ//dFPa28rc1hjyy+qzCbXPMR91Fb6F1VGTQHg= github.com/leekchan/accounting v1.0.0/go.mod h1:3timm6YPhY3YDaGxl0q3eaflX0eoSx3FXn7ckHe4tO0= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -660,20 +582,15 @@ github.com/mattn/go-colorable v0.0.10-0.20170816031813-ad5389df28cd/go.mod h1:9v github.com/mattn/go-isatty v0.0.2/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v2.0.2+incompatible h1:qzw9c2GNT8UFrgWNDhCTqRqYUSmu/Dav/9Z58LGpk7U= github.com/mattn/go-sqlite3 v2.0.2+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= -github.com/mdlayher/netlink v1.1.0 h1:mpdLgm+brq10nI9zM1BpX1kpDbh3NLl3RSnVq6ZSkfg= github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= -github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= -github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs= github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= @@ -688,9 +605,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -707,40 +622,25 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= -github.com/nwaples/rardecode v1.1.2 h1:Cj0yZY6T1Zx1R7AhTbyGSALm44/Mmq+BAPc4B/p/d3M= github.com/nwaples/rardecode v1.1.2/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= -github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= -github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrzN7IgKZc= github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y= -github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs= github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= -github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= -github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pion/datachannel v1.5.8 h1:ph1P1NsGkazkjrvyMfhRBUAWMxugJjq2HfQifaOoSNo= github.com/pion/datachannel v1.5.8/go.mod h1:PgmdpoaNBLX9HNzNClmdki4DYW5JtI7Yibu8QzbL3tI= github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= @@ -785,8 +685,6 @@ github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLh github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= -github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= -github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= github.com/pion/turn v1.3.5/go.mod h1:zGPB7YYB/HTE9MWn0Sbznz8NtyfeVeanZ834cG/MXu0= github.com/pion/turn v1.4.0 h1:7NUMRehQz4fIo53Qv9ui1kJ0Kr1CA82I81RHKHCeM80= github.com/pion/turn v1.4.0/go.mod h1:aDSi6hWX/hd1+gKia9cExZOR0MU95O7zX9p3Gw/P2aU= @@ -795,8 +693,6 @@ github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= github.com/pion/webrtc/v3 v3.3.4 h1:v2heQVnXTSqNRXcaFQVOhIOYkLMxOu1iJG8uy1djvkk= github.com/pion/webrtc/v3 v3.3.4/go.mod h1:liNa+E1iwyzyXqNUwvoMRNQ10x8h8FOeJKL8RkIbamE= -github.com/pivotal-cf-experimental/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:AbOpFa7UXCGaV+aq9tvFdSHEhmcb8uO6nKZdYhKsT1I= -github.com/pivotal-cf-experimental/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:4+wzrM70C+Ky5iZiA6lNV5J48jnGmu8YcbmuVWdlt5s= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -847,7 +743,6 @@ github.com/refraction-networking/wazero v1.7.1-w h1:z7Ty5PsMkJEDBCsn3ELUjceQGBT0 github.com/refraction-networking/wazero v1.7.1-w/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg= github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -864,27 +759,19 @@ github.com/samber/lo v1.46.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5 github.com/shadowsocks/go-shadowsocks2 v0.1.5 h1:PDSQv9y2S85Fl7VBeOMF9StzeXZyK1HakRm86CUbr28= github.com/shadowsocks/go-shadowsocks2 v0.1.5/go.mod h1:AGGpIoek4HRno4xzyFiAtLHkOpcoznZEkAccaI/rplM= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs= -github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/songgao/water v0.0.0-20190725173103-fd331bda3f4b/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E= -github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 h1:TG/diQgUe0pntT/2D9tmUCz4VNwm9MfrtPr0SU2qSX8= github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -898,8 +785,6 @@ github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1: github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -907,7 +792,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -923,15 +807,12 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/templexxx/cpu v0.1.1 h1:isxHaxBXpYFWnk2DReuKkigaZyrjs2+9ypIdGP4h+HI= github.com/templexxx/cpu v0.1.1/go.mod h1:w7Tb+7qgcAlIyX4NhLuDKt78AHA5SzPmq0Wj6HiEnnk= github.com/templexxx/xorsimd v0.4.3 h1:9AQTFHd7Bhk3dIT7Al2XeBX5DWOvsUPZCuhyAtNbHjU= github.com/templexxx/xorsimd v0.4.3/go.mod h1:oZQcD6RFDisW2Am58dSAGwwL6rHjbzrlu25VDqfWkQg= -github.com/ti-mo/conntrack v0.3.0 h1:572/72R9la2FVvO6CbsLiCmR48U3pgCvIlLKoUrExDU= github.com/ti-mo/conntrack v0.3.0/go.mod h1:tPSYNx21TnjxGz99pLD/lAN4fuEViaJZz+pliMqnovk= -github.com/ti-mo/netfilter v0.3.1 h1:+ZTmeTx+64Jw2N/1gmqm42kruDWjQ90SMjWEB1e6VDs= github.com/ti-mo/netfilter v0.3.1/go.mod h1:t/5HvCCHA1LAYj/AZF2fWcJ23BQTA7lzTPCuwwi7xQY= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= @@ -947,32 +828,22 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.1 h1:JDkWS7Axy5ziNM3svylLhpSgqjPDb+BgVUbXoDo+iPw= -github.com/vishvananda/netns v0.0.1/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vulcand/oxy v1.4.2 h1:KibUVdKrwy7eXR3uHS2pYoZ9dCzKVcgDNHD2jkPZmxU= -github.com/vulcand/oxy v1.4.2/go.mod h1:Yq8OBb0XWU/7nPSglwUH5LS2Pcp4yvad8SVayobZbSo= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/wlynxg/anet v0.0.3 h1:PvR53psxFXstc12jelG6f1Lv4MWqE0tI76/hHGjh9rg= github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E= -github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0= github.com/xtaci/smux v1.5.10/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= github.com/xtaci/smux v1.5.27 h1:uIU1dpJQQWUCmGxXBgajLfc8cMMb13hCitj+HC5yC/Q= github.com/xtaci/smux v1.5.27/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb h1:qRSZHsODmAP5qDvb3YsO7Qnf3TRiVbGxNG/WYnlM4/o= gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb/go.mod h1:gvdJuZuO/tPZyhEV8K3Hmoxv/DWud5L4qEQxfYjEUTo= -gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d h1:tJ8F7ABaQ3p3wjxwXiWSktVDgjZEXkvaRawd2rIq5ws= gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d/go.mod h1:9GcM8QNU9/wXtEEH2q8bVOnPI7FtIF6VVLzZ1l6Hgf8= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= @@ -980,13 +851,10 @@ go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 h1:ZtfnDL+tUrs1F0Pzfwbg2d59Gru9NCH3bgSHBM6LDwU= go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 h1:wNMDy/LVGLj2h3p6zg4d0gypKfWKSWI14E1C4smOgl8= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0/go.mod h1:YfbDdXAAkemWJK3H/DshvlrxqFB2rtW4rY6ky/3x/H0= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= @@ -996,7 +864,6 @@ go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGX go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= -go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= @@ -1007,8 +874,6 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -1048,7 +913,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20241016134751-7ff83004ec2c h1:zuNS/LWsEpPTLfrmBkis6Xofw3nieAqB4hYLn8+uswk= golang.org/x/mobile v0.0.0-20241016134751-7ff83004ec2c/go.mod h1:snk1Mn2ZpdKCt90JPEsDh4sL3ReK520U2t0d7RHBnSU= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= @@ -1248,12 +1112,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1270,7 +1131,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gvisor.dev/gvisor v0.0.0-20240912010154-1243db29d375 h1:wLcac6WGtl2F79rF0Rr0uHbwxfPry99Nuqp1cEo4JQo= gvisor.dev/gvisor v0.0.0-20240912010154-1243db29d375/go.mod h1:sxc3Uvk/vHcd3tj7/DHVBoR5wvWT/MmRq2pj7HRJnwU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1279,31 +1139,14 @@ howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= -modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= -modernc.org/ccgo/v4 v4.20.7 h1:skrinQsjxWfvj6nbC3ztZPJy+NuwmB3hV9zX/pthNYQ= -modernc.org/ccgo/v4 v4.20.7/go.mod h1:UOkI3JSG2zT4E2ioHlncSOZsXbuDCZLvPi3uMlZT5GY= -modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= -modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= -modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= -modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/libc v1.59.1 h1:ZVsgtxNu5OyIsX0Qq6T4aN7IxP1YTmvKZuf8T5fV0Ro= modernc.org/libc v1.59.1/go.mod h1:EY/egGEU7Ju66eU6SBqCNYaFUDuc4npICkMWnU5EE3A= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= -modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= -modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= modernc.org/sqlite v1.32.0 h1:6BM4uGza7bWypsw4fdLRsLxut6bHe4c58VeqjRgST8s= modernc.org/sqlite v1.32.0/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA= -modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= -modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y= nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= zombiezen.com/go/sqlite v1.3.0 h1:98g1gnCm+CNz6AuQHu0gqyw7gR2WU3O3PJufDOStpUs= zombiezen.com/go/sqlite v1.3.0/go.mod h1:yRl27//s/9aXU3RWs8uFQwjkTG9gYNGEls6+6SvrclY= From ad013058744626b260847c56389bb51fd6599c86 Mon Sep 17 00:00:00 2001 From: atavism Date: Sun, 1 Dec 2024 06:13:56 -0800 Subject: [PATCH 14/23] update flashlight and run go mod tidy --- go.sum | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) diff --git a/go.sum b/go.sum index 3ffe4a7d0..d044e2593 100644 --- a/go.sum +++ b/go.sum @@ -4,15 +4,20 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= crawshaw.io/sqlite v0.3.2/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= filippo.io/edwards25519 v1.0.0-rc.1.0.20210721174708-390f27c3be20/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.torproject.org/pluggable-transports/goptlib.git v1.0.0/go.mod h1:YT4XMSkuEXbtqlydr9+OxqFAyspUv0Gr9qhM3B++o/Q= +git.torproject.org/pluggable-transports/goptlib.git v1.2.0 h1:0qRF7Dw5qXd0FtZkjWUiAh5GTutRtDGL4GXUDJ4qMHs= git.torproject.org/pluggable-transports/goptlib.git v1.2.0/go.mod h1:4PBMl1dg7/3vMWSoWb46eGWlrxkUyn/CAJmxhDLAlDs= +github.com/1Password/srp v0.2.0 h1:PZKAafEyExnwevliL6d2+FDhJXZ0phxqiG2OeIaj9Xk= github.com/1Password/srp v0.2.0/go.mod h1:LIGqQ7eEA0UJT98j7sXk60QWVpHJ3g00BX6LOm9kYTc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Jigsaw-Code/outline-sdk v0.0.16 h1:WbHmv80FKDIpzEmR3GehTbq5CibYTLvcxIIpMMILiEs= github.com/Jigsaw-Code/outline-sdk v0.0.16/go.mod h1:e1oQZbSdLJBBuHgfeQsgEkvkuyIePPwstUeZRGq0KO8= +github.com/Jigsaw-Code/outline-ss-server v1.5.0 h1:Vz+iS0xR7i3PrLD82pzFFwZ9fsh6zrNawMeYERR8VTc= github.com/Jigsaw-Code/outline-ss-server v1.5.0/go.mod h1:KaebwBiCWDSkgsJrJIbGH0szON8CZq4LgQaFV8v3RM4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/OperatorFoundation/Replicant-go/Replicant/v3 v3.0.23 h1:g0kC1BDonLwNse78HRsudElKEDfXHusLQ9Nfekl/l0o= github.com/OperatorFoundation/Replicant-go/Replicant/v3 v3.0.23/go.mod h1:QVlygHzbNc/fX+OHurCRC0AFwISJAUQbPaqdEfAkUio= @@ -31,14 +36,18 @@ github.com/RoaringBitmap/roaring v1.9.4 h1:yhEIoH4YezLYT04s1nHehNO64EKFTop/wBhxv github.com/RoaringBitmap/roaring v1.9.4/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/Yawning/chacha20 v0.0.0-20170904085104-e3b1f968fc63 h1:I6/SJSN9wJMJ+ZyQaCHUlzoTA4ypU5Bb44YWR1wTY/0= github.com/Yawning/chacha20 v0.0.0-20170904085104-e3b1f968fc63/go.mod h1:nf+Komq6fVP4SwmKEaVGxHTyQGKREVlwjQKpvOV39yE= github.com/aead/ecdh v0.2.0 h1:pYop54xVaq/CEREFEcukHRZfTdjiWvYIsZDXXrBapQQ= github.com/aead/ecdh v0.2.0/go.mod h1:a9HHtXuSo8J1Js1MwLQx2mBhkXMT6YwUmVVEY4tTB8U= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k= +github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8= github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI= +github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= +github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -67,6 +76,7 @@ github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+ github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 h1:9o/yVzzLzYaBDFx8B27yhkvBLhNnRAuSTK7Y+yZKVtU= github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83/go.mod h1:xvHjsYWWP7yO8PZwtuIp/k0DBlu07pSJqH4SEC78Vwc= +github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62 h1:P04VG6Td13FHMgS5ZBcJX23NPC/fiC4cp9bXwYujdYM= github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62/go.mod h1:66cFKPCO7Sl4vbFnAaSq7e4OXtdMhRSBagJGWgmpJbM= github.com/anacrolix/missinggo v0.0.0-20180725070939-60ef2fbf63df/go.mod h1:kwGiTUTZ0+p4vAz3VbAI5a30t2YbvemcmspjKwrAz5s= github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= @@ -143,6 +153,7 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo= github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= @@ -156,11 +167,14 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= +github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/dsoprea/go-exif/v2 v2.0.0-20200321225314-640175a69fe4/go.mod h1:Lm2lMM2zx8p4a34ZemkaUV95AnMl4ZvLbCUbwOvLC2E= @@ -207,6 +221,7 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.3-0.20170329110642-4da3e2cfbabc/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/garyburd/redigo v1.1.1-0.20170914051019-70e1b1943d4f/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= @@ -215,13 +230,16 @@ github.com/gaukas/wazerofs v0.1.0 h1:wIkW1bAxSnpaaVkQ5LOb1tm1BXdVap3eKjJpVWIqt2E github.com/gaukas/wazerofs v0.1.0/go.mod h1:+JECB9Fwt0taPqSgHckG9lmT3tcoVK+9VJozTsq9UlI= github.com/getlantern/algeneva v0.0.0-20240605225338-caba0b3edf03 h1:VaBQdRGkP47xBr8OIAkQFt52KLXMZQhbYrwZiOK7rPw= github.com/getlantern/algeneva v0.0.0-20240605225338-caba0b3edf03/go.mod h1:PrNR8tMXO26YNs8K9653XCUH7u2Kv4OdfFC3Ke1GsX0= +github.com/getlantern/appdir v0.0.0-20200615192800-a0ef1968f4da h1:T/pxF37Z9SIQCHhMMUITZ3rhKRL0Noi9XxNwxKdBNw0= github.com/getlantern/appdir v0.0.0-20200615192800-a0ef1968f4da/go.mod h1:3vR6+jQdWfWojZ77w+htCqEF5MO/Y2twJOpAvFuM9po= +github.com/getlantern/autoupdate v0.0.0-20240926204302-11d9aa2df948 h1:QPpGiY3ljAaNe3qdx22cTVzDPQLS/4yUeuvyGgfADCA= github.com/getlantern/autoupdate v0.0.0-20240926204302-11d9aa2df948/go.mod h1:ohIVs2H6Wb58ZaCw/OAP+z6RPFVaRokAnldy+ATGwdQ= github.com/getlantern/broflake v0.0.0-20241127130800-763b7ebbf090 h1:amN67m7WRx4oz3Si4VpX3p5rgWdPqYZ7TOW8v1n3PYk= github.com/getlantern/broflake v0.0.0-20241127130800-763b7ebbf090/go.mod h1:iH3x6VHpNclNAY8Nuuhp+8/b2Lv4ng33lSt7DuNH/4E= github.com/getlantern/bufconn v0.0.0-20190625204133-a08544339f8d/go.mod h1:d6O4RY+V87kIt4o9wru4SaNo7C2NAkD3YnmJFXEpODo= github.com/getlantern/bufconn v0.0.0-20210901195825-fd7c0267b493 h1:8WjDNmpDLFVsAfcnHxqF4pfVKkdAQxyJ9iCHB4LxSfc= github.com/getlantern/bufconn v0.0.0-20210901195825-fd7c0267b493/go.mod h1:d6O4RY+V87kIt4o9wru4SaNo7C2NAkD3YnmJFXEpODo= +github.com/getlantern/bytecounting v0.0.0-20190530140808-3b3f10d3b9ab h1:bKsTXN1XgjiWuciuEChVIPFXWD8sTASsvjkMAGMEb/4= github.com/getlantern/bytecounting v0.0.0-20190530140808-3b3f10d3b9ab/go.mod h1:O/UvKlcgUd/tsplTbFesvYtqGENHVE/yO8DJ1sd+x+g= github.com/getlantern/byteexec v0.0.0-20170405023437-4cfb26ec74f4/go.mod h1:4WCQkaCIwta0KlF9bQZA1jYqp8bzIS2PeCqjnef8nZ8= github.com/getlantern/byteexec v0.0.0-20220903142956-e6ed20032cfd h1:0xt9OTbV50a/+ZarMcr86ybWiN1v+bbwzdnVuXHzR/o= @@ -242,6 +260,7 @@ github.com/getlantern/detour v0.0.0-20230503144615-d3106a68f79e h1:ah9RgyL8S76l/ github.com/getlantern/detour v0.0.0-20230503144615-d3106a68f79e/go.mod h1:BndJgV9V8+iLA35NIVqk7u0VTLUGgkc1jmVI+gWJAtI= github.com/getlantern/dhtup v0.0.0-20240217002836-8587da02c55c h1:pP2e2eiTLoHQBJGl1N/VyBfkQ/+Lag1O/h2VkitZwXM= github.com/getlantern/dhtup v0.0.0-20240217002836-8587da02c55c/go.mod h1:XJZGC2a7v4I+0IzQdwsLYiqRtEh3jgtdp/l+PmNQkWQ= +github.com/getlantern/diagnostics v0.0.0-20230503185158-c2fc28ed22fe h1:Uk3e38UmJhjM+ypM6O38cIYac2yZMhoDocaEm9U7qJE= github.com/getlantern/diagnostics v0.0.0-20230503185158-c2fc28ed22fe/go.mod h1:B82GdSnu6Ex9Ir1PaChox3TirdZbVt4Zad3Al/YtdgE= github.com/getlantern/dns v0.0.0-20240124035051-0d45dd3cfe54 h1:BKBCh+EwJiowxU1+CMa8fIQbD1kQLVhxes6GKu56R6U= github.com/getlantern/dns v0.0.0-20240124035051-0d45dd3cfe54/go.mod h1:zaFhzOF3ndksog07db0DZNIzTVeuAirjwWeuam1Azo8= @@ -254,6 +273,7 @@ github.com/getlantern/elevate v0.0.0-20220903142053-479ab992b264 h1:q50MSzoIIKot github.com/getlantern/elevate v0.0.0-20220903142053-479ab992b264/go.mod h1:2VB8zy/kMNX347i5fdusJbPNAZE26u8qoHJDy7CWP9A= github.com/getlantern/ema v0.0.0-20190620044903-5943d28f40e4 h1:PMK8QQn9GLTQXdHnqoNhyToOa8snagaZVt9Xb36NEUc= github.com/getlantern/ema v0.0.0-20190620044903-5943d28f40e4/go.mod h1:tzRwT19aDrWSr6yRDs8iOvaXXCau96EgWsgGT9wIpoQ= +github.com/getlantern/enhttp v0.0.0-20210901195634-6f89d45ee033 h1:HbjEpFFiRYcySVkFMdn3kl3OUU0UZwMdcXzY5gXUEQo= github.com/getlantern/enhttp v0.0.0-20210901195634-6f89d45ee033/go.mod h1:kHP/nfmHj9HJVN5Cb+1RFNRLR0O0nx40YENc4wKIe6s= github.com/getlantern/errors v0.0.0-20190325191628-abdb3e3e36f7/go.mod h1:l+xpFBrCtDLpK9qNjxs+cHU6+BAdlBaxHqikB6Lku3A= github.com/getlantern/errors v1.0.1/go.mod h1:l+xpFBrCtDLpK9qNjxs+cHU6+BAdlBaxHqikB6Lku3A= @@ -275,13 +295,17 @@ github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtA github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= github.com/getlantern/flashlight/v7 v7.6.147 h1:bL20KaA+UkPzYI9uXMDJHf+gSpHJbVBV9f/8+/EwFHI= github.com/getlantern/flashlight/v7 v7.6.147/go.mod h1:sLQXxC8MW4gqHXFjINLxbbz1GOPEf6Hwvs30gdVsAk8= +github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw= github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI= github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2 h1:h3TZ7ye/1fqOLqfwTho4iRSEQqTMKVJIsOF+5XNyhus= github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2/go.mod h1:NfZDG8pmTL3wvo/s/sflpJFsgIL7etelgwzDRtO4HIM= +github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9 h1:mSg57/+t59Q08AqArlhW+3N1AVPn5ox0dTOYonRps6w= github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9/go.mod h1:RjQ0krF8NTCc5xo2Q1995/vZBnYg33h8svn15do7dLg= github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5 h1:RBKofGGMt2k6eGBwX8mky9qunjL+KnAp9JdzXjiRkRw= github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5/go.mod h1:kGHRXch95rnGLHjER/GhhFiHvfnqNz7KqWD9kGfATHY= +github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93 h1:CFLw2b6vgOmpxsRWRiTd46tiR6YKg2crIuTu4cINYcY= github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93/go.mod h1:wgB2BFT8ZaPKyKOQ/5dljMG/YIow+AIXyq4KBwJ5sGQ= +github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc h1:qZ/HlURAOgGRKtqDGimPwL2w5PkvW7Ap+c1bGRK0pzU= github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc/go.mod h1:DQAFBxfQlSru9Loud3pLM+rF//qf0FQBtB//grF89IA= github.com/getlantern/golog v0.0.0-20190809085441-26e09e6dd330/go.mod h1:zx/1xUUeYPy3Pcmet8OSXLbF47l+3y6hIPpyLWoR9oc= github.com/getlantern/golog v0.0.0-20190830074920-4ef2e798c2d7/go.mod h1:zx/1xUUeYPy3Pcmet8OSXLbF47l+3y6hIPpyLWoR9oc= @@ -290,10 +314,13 @@ github.com/getlantern/golog v0.0.0-20201105130739-9586b8bde3a9/go.mod h1:ZyIjgH/ github.com/getlantern/golog v0.0.0-20210606115803-bce9f9fe5a5f/go.mod h1:ZyIjgH/1wTCl+B+7yH1DqrWp6MPJqESmwmEQ89ZfhvA= github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65 h1:NlQedYmPI3pRAXJb+hLVVDGqfvvXGRPV8vp7XOjKAZ0= github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65/go.mod h1:+ZU1h+iOVqWReBpky6d5Y2WL0sF2Llxu+QcxJFs2+OU= +github.com/getlantern/gonat v0.0.0-20201001145726-634575ba87fb h1:tDQA66mL1vTHKSMu3Ras/9Tk884ipPAhcdQHXpnDhxg= github.com/getlantern/gonat v0.0.0-20201001145726-634575ba87fb/go.mod h1:ysiamkJHyOrnlNmtDCCccH1NbFdgEBSJRg44DWiOxcY= github.com/getlantern/gotun v0.0.0-20190809092752-6d35bb1397ee/go.mod h1:zvsZQrsl7Yrmi+ENk5WZFT7dQaYtihAcI0H/9+LacqQ= +github.com/getlantern/gowin v0.0.0-20160824205538-88fa116ddffc h1:4PgzRiHOP7qfq6kBzcj7dSbE6QmAoD5P87+rJvOH0Gs= github.com/getlantern/gowin v0.0.0-20160824205538-88fa116ddffc/go.mod h1:UX71eBZilSY+UR7rfdMh0rA/IY0HS7tXRoMO9EiKXKE= github.com/getlantern/grtrack v0.0.0-20160824195228-cbf67d3fa0fd/go.mod h1:RkQEgBdrJCH5tYJP2D+a/aJ216V3c9q8w/tCJtEiDoY= +github.com/getlantern/grtrack v0.0.0-20231025115619-bfbfadb228f3 h1:3eOqQA2WKd5tvepSwHXcN1IteDBnWcrs4dAoKVpGZ9k= github.com/getlantern/grtrack v0.0.0-20231025115619-bfbfadb228f3/go.mod h1:esUcij+yiXH9mSlzZChtoSClQ9vr8cjNgEbcDHVqJfI= github.com/getlantern/hellosplitter v0.1.1 h1:eV01w6T9Ca7wjctte71hNBST+lsbSGKf82yxSed3XJ4= github.com/getlantern/hellosplitter v0.1.1/go.mod h1:8TgRrwnkkz8PNiqMQVOorGtmIBXBSj7YrRCuDP8NXLg= @@ -303,14 +330,17 @@ github.com/getlantern/hex v0.0.0-20220104173244-ad7e4b9194dc/go.mod h1:D9RWpXy/E github.com/getlantern/hidden v0.0.0-20190325191715-f02dbb02be55/go.mod h1:6mmzY2kW1TOOrVy+r41Za2MxXM+hhqTtY3oBKd2AgFA= github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770 h1:cSrD9ryDfTV2yaur9Qk3rHYD414j3Q1rl7+L0AylxrE= github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770/go.mod h1:GOQsoDnEHl6ZmNIL+5uVo+JWRFWozMEp18Izcb++H+A= +github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e h1:qNYdR1Zb/HrE9QxOWkktuS4cG2TRjuoO/ssLDFR1rPE= github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e/go.mod h1:gdTIGBw1dSTKkQV+3XHI27R++69ENeWPiWSnq3zLF8g= github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca h1:Of3VwFEfKbVnK5/VGy05XUbi6QvTs5Y2eLDfPv3O50E= github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca/go.mod h1:TNC/xJFmctsSGyXqcnVWwCRCPD/4zGQP7yBVnLDRa/U= +github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c h1:+JnT+Rwa/3rksc4Zi0u6fJ/WX+tPK58GtsrcXWVUU2U= github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c/go.mod h1:6yS3MFZmWDK0zxWXX0619QzZpqmCaHJ8P83Ee4QcTq0= github.com/getlantern/idletiming v0.0.0-20190529182719-d2fbc83372a5/go.mod h1:MGP8kEgZGgAhvHISt0hJGQgxg/VAqGdw3+kSZBnfC/4= github.com/getlantern/idletiming v0.0.0-20200228204104-10036786eac5/go.mod h1:McaLC6faRlxJ9QjjqSjpEeYIjKnKA8+dzjoR+eYXCio= github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db h1:w/Br8vclvX3RlHV+VFkuNkcm3hwEXTtqXMoOqKPUicg= github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db/go.mod h1:kW4RHAFReMopujQCzcYxjOAg4XZOeuSrybIcM9FNGto= +github.com/getlantern/ipproxy v0.0.0-20240923151842-ff95aca6e3dc h1:6yCC6u18l/RcxiEZsJaV6BxTBSRDA4TdtHayRpGJMKQ= github.com/getlantern/ipproxy v0.0.0-20240923151842-ff95aca6e3dc/go.mod h1:rkY8JPMJmzi29/uTE6o/6BbtOjt1lcMsrI+QwZK4MU8= github.com/getlantern/iptool v0.0.0-20210721034953-519bf8ce0147/go.mod h1:hfspzdRcvJ130tpTPL53/L92gG0pFtvQ6ln35ppwhHE= github.com/getlantern/iptool v0.0.0-20230112135223-c00e863b2696 h1:D7wbL2Ww6QN5SblEDMiQcFulqz2jgcvawKaNBTzHLvQ= @@ -321,22 +351,27 @@ github.com/getlantern/kcp-go/v5 v5.0.0-20220503142114-f0c1cd6e1b54 h1:JqIiaDpL6C github.com/getlantern/kcp-go/v5 v5.0.0-20220503142114-f0c1cd6e1b54/go.mod h1:KFBWdR0PdEQK0JtGcE1lhAoYFVTRxWDFfYBARPb0t9Q= github.com/getlantern/kcpwrapper v0.0.0-20230327091313-c12d7c17c6de h1:RS4Tx7aVExrAXsgvrXSln9iQ5HZNPpvHjJGM/MQH8ZE= github.com/getlantern/kcpwrapper v0.0.0-20230327091313-c12d7c17c6de/go.mod h1:UVPVk1fNbqBceE4i+x/qbNxUNQ7gMACdOukoIbXM9jc= +github.com/getlantern/keepcurrent v0.0.0-20221014183517-fcee77376b89 h1:gjlTAADW8ZUrIey+u1ZtbVlI91bqI0Bu+GBxvRlBBqo= github.com/getlantern/keepcurrent v0.0.0-20221014183517-fcee77376b89/go.mod h1:EtJEobtQH/HiQsZLyRjlrnq/fu7vfgnTMzhbmUqkZ3M= github.com/getlantern/keyman v0.0.0-20180207174507-f55e7280e93a/go.mod h1:FMf0g72BHs14jVcD8i8ubEk4sMB6JdidBn67d44i3ws= github.com/getlantern/keyman v0.0.0-20200819205636-76fef27c39f1/go.mod h1:FMf0g72BHs14jVcD8i8ubEk4sMB6JdidBn67d44i3ws= github.com/getlantern/keyman v0.0.0-20230503155501-4e864ca2175b h1:iyEuk8ARQC9HfraqC4r3leBhU55R1TV7bAiyPYE54kA= github.com/getlantern/keyman v0.0.0-20230503155501-4e864ca2175b/go.mod h1:ZJ+yDaZkJ/JU9j7EQa3UUh6ouedrNDDLA5OiowS1Iuk= +github.com/getlantern/lampshade v0.0.0-20201109225444-b06082e15f3a h1:z7G1v79GB1qRrkcbzF0nrLzV/+dwdGmamEZAp0ff+z0= github.com/getlantern/lampshade v0.0.0-20201109225444-b06082e15f3a/go.mod h1:cGOfTjvllC9bcwS7cVW6tGT6fXc8Dki384uFjm7XBnw= github.com/getlantern/lantern-algeneva v0.0.0-20240930181006-6d3c00db1d5d h1:ACBwPR4du54Qw+X5ajsbMqOFR8euGZRdMGkvTDS7I60= github.com/getlantern/lantern-algeneva v0.0.0-20240930181006-6d3c00db1d5d/go.mod h1:bDcK4RWBjBO+bBPLTCmaEyYK+n0/w0TrzvSCJOQmkgk= +github.com/getlantern/launcher v0.0.0-20230622120034-fe87f9bff286 h1:b8XesQLtoq58M8FcYxxfWDUcBOzbGfBJGDOZDQ4PjYs= github.com/getlantern/launcher v0.0.0-20230622120034-fe87f9bff286/go.mod h1:pEDM+G+PFz616x02zkWcmhjaeZ9rHDKZL8stK3uE9J8= github.com/getlantern/mandrill v0.0.0-20221004112352-e7c04248adcb h1:oyEMOT9jn4bzKyivF2sVBogsXyL8fBCK7HIT/P6h64Y= github.com/getlantern/mandrill v0.0.0-20221004112352-e7c04248adcb/go.mod h1:gz4iIB+vPk8hWxkAnnZSudQuIpBMnW7i89eHl9Fl+I8= +github.com/getlantern/measured v0.0.0-20230919230611-3d9e3776a6cd h1:pDfqh9yd58OW9vQzv4U+q6G+LfbNXVhbWcBWmC5Dkm4= github.com/getlantern/measured v0.0.0-20230919230611-3d9e3776a6cd/go.mod h1:QG6d9+nAxD1PjVjgGLUUHPZBQUp20/h7j8a3kxd/8Rc= github.com/getlantern/meta-scrubber v0.0.1 h1:WknyffbSpb5kEwDQ6lrN9+KohCGnqhs5zQfGk4sFRGo= github.com/getlantern/meta-scrubber v0.0.1/go.mod h1:nYmOMQXbex3emWMNbt/iDKTXE1q53x1dDxCspxjwxyY= github.com/getlantern/mockconn v0.0.0-20190708122800-637bd46d8034/go.mod h1:+F5GJ7qGpQ03DBtcOEyQpM30ix4BLswdaojecFtsdy8= github.com/getlantern/mockconn v0.0.0-20191023022503-481dbcceeb58/go.mod h1:+F5GJ7qGpQ03DBtcOEyQpM30ix4BLswdaojecFtsdy8= +github.com/getlantern/mockconn v0.0.0-20200818071412-cb30d065a848 h1:2MhMMVBTnaHrst6HyWFDhwQCaJ05PZuOv1bE2gN8WFY= github.com/getlantern/mockconn v0.0.0-20200818071412-cb30d065a848/go.mod h1:+F5GJ7qGpQ03DBtcOEyQpM30ix4BLswdaojecFtsdy8= github.com/getlantern/mtime v0.0.0-20170117193331-ba114e4a82b0/go.mod h1:u537FS7ld4Whf7h7/0ql/myAudWWBNgeRhgE9XXH4Pk= github.com/getlantern/mtime v0.0.0-20200228202836-084e1d8282b0/go.mod h1:GfzwugvtH7YcmNIrHHizeyImsgEdyL88YkdnK28B14c= @@ -344,11 +379,13 @@ github.com/getlantern/mtime v0.0.0-20200417132445-23682092d1f7 h1:03J6Cb42EG06lH github.com/getlantern/mtime v0.0.0-20200417132445-23682092d1f7/go.mod h1:GfzwugvtH7YcmNIrHHizeyImsgEdyL88YkdnK28B14c= github.com/getlantern/multipath v0.0.0-20230510135141-717ed305ef50 h1:+3K4Zk0NuXGHdPOL6uqchUUFyLUIl0CIdlp6ksgZxDM= github.com/getlantern/multipath v0.0.0-20230510135141-717ed305ef50/go.mod h1:uzxEbpNdIj+Iw9lEVuY1HF3OdAJ4RJykQHSL8lPee4M= +github.com/getlantern/nettest v1.0.0 h1:xg8vq9JrGzrFGFkFGwZwIJ5+kwtvyqNDIADwrANvhQg= github.com/getlantern/nettest v1.0.0/go.mod h1:8wY0QwrdpkayCBQXjhZoJuwu2IHfp4UErrxgwaJ2UM4= github.com/getlantern/netx v0.0.0-20190110220209-9912de6f94fd/go.mod h1:wKdY0ikOgzrWSeB9UyBVKPRhjXQ+vTb+BPeJuypUuNE= github.com/getlantern/netx v0.0.0-20211206143627-7ccfeb739cbd/go.mod h1:WEXF4pfIfnHBUAKwLa4DW7kcEINtG6wjUkbL2btwXZQ= github.com/getlantern/netx v0.0.0-20240830183145-c257516187f0 h1:1K7Rbp2V/XGlZohPRz4IncT6C5RTiSGI2IB9YF34pbI= github.com/getlantern/netx v0.0.0-20240830183145-c257516187f0/go.mod h1:JbzAvxJWngaUtz5QqKz9w6zHU0Efw21cuY0aNN209Kc= +github.com/getlantern/notifier v0.0.0-20240830181717-11f4c6c3fa95 h1:vrS7lr+avjlKMoyVS1oW3Fmj6Yr0IgyzmsPGvCQG7Xk= github.com/getlantern/notifier v0.0.0-20240830181717-11f4c6c3fa95/go.mod h1:McPrM/v48T21UaFItGjKB5bojFHIel9mKvtRMOjlXyo= github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA= github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA= @@ -356,12 +393,19 @@ github.com/getlantern/ops v0.0.0-20231025133620-f368ab734534 h1:3BwvWj0JZzFEvNNi github.com/getlantern/ops v0.0.0-20231025133620-f368ab734534/go.mod h1:ZsLfOY6gKQOTyEcPYNA9ws5/XHZQFroxqCOhHjGcs9Y= github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175 h1:JWH5BB2o0eAeGs0tZnFPpQGx+nMIo/WmxKnj2hnGjgE= github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175/go.mod h1:h3S9LBmmzN/xM+lwYZHE4abzTtCTtidKtG+nxZcCZX0= +github.com/getlantern/packetforward v0.0.0-20201001150407-c68a447b0360 h1:pijUoofaQcAM/8zbDzZM2LQ90kGVbKfnSAkFnQwLZZU= github.com/getlantern/packetforward v0.0.0-20201001150407-c68a447b0360/go.mod h1:nsJPNYUSY96xB+p7uiDW8O4uiKea+KjeUdS5d6tf9IU= +github.com/getlantern/pathdb v0.0.0-20231026090702-54ee1ddd99eb h1:rbkflUPjr83ON7c+4LqU2Y/rJzv9P/fmocXDLLm0hWQ= github.com/getlantern/pathdb v0.0.0-20231026090702-54ee1ddd99eb/go.mod h1:SFQy+f58IbLpnbq2nVqlq7ccwaUiO7ablKv631WVIuc= github.com/getlantern/preconn v1.0.0 h1:DsY3l/y/BJUj86WyaxXylbJnCC9QbKcc3D6js6rFL60= github.com/getlantern/preconn v1.0.0/go.mod h1:i/AnXvx715Fq7HgZLlmQlw3sGfEkku8BQT5hLHMK4+k= github.com/getlantern/probe v0.0.0-20191107230642-ed284e08029a/go.mod h1:EPE0nd9YNS2FTIz+2EOkqojCuqaQlJ+fTiLPklsqe/E= +github.com/getlantern/probe v0.0.0-20211216020459-69afa01c1c5c h1:bWusw8SYvl/iq+nHzSIe4oC7HdwaCN0KQEZkIHimamM= +github.com/getlantern/probe v0.0.0-20211216020459-69afa01c1c5c/go.mod h1:ditYj5obTW66F7c2nOTFUONMADmbzkzOsnkWfFWH3jk= github.com/getlantern/probednet v0.0.0-20190725133252-1cfdb2354b4d/go.mod h1:7sl7hPjPDAqXyxVx7mhrKfvb4oCX/ROhcs16w2EhWX8= +github.com/getlantern/probednet v0.0.0-20211216020507-22fd9c1d3bf6 h1:8jg6OehdQr90Ybmyc68raXEqM/1hk8E7F2YAUfmcvzE= +github.com/getlantern/probednet v0.0.0-20211216020507-22fd9c1d3bf6/go.mod h1:noglym51kFdkZEV/WjiIzRKV6qwwTI9/vSAjeOI/zCU= +github.com/getlantern/profiling v0.0.0-20160317154340-2a15afbadcff h1:q5GcvgoGNRJ5yVCr5p0vUcXyYOGvTb+Lq/g4TW2HbfA= github.com/getlantern/profiling v0.0.0-20160317154340-2a15afbadcff/go.mod h1:eHf4vTrd0oaXLtbz+zM28cfsX4ylva7hbM2zt4+axZo= github.com/getlantern/proxy/v3 v3.0.0-20240328103708-9185589b6a99 h1:kyd1bT1H7CXasGVLfY4sai9cpDaZ12Ed7Qi7yIeumqw= github.com/getlantern/proxy/v3 v3.0.0-20240328103708-9185589b6a99/go.mod h1:I5SvkXI843L2Hvsi0TG8H1jCXtaApOemBZZD1/N0Inw= @@ -370,6 +414,7 @@ github.com/getlantern/psmux v1.5.15 h1:VUCEk8MIsvAj90wNYRyY2fE9ZL4LIRhi1W5V9aycA github.com/getlantern/psmux v1.5.15/go.mod h1:nyp/sr4uTbWpUh7Q2WovRb07LeLNUxDg8kAdS726FIw= github.com/getlantern/quicwrapper v0.0.0-20240229232335-e6b4c3c30b2f h1:w/PNBtsqHpq7df3CYl1Pq55ktQto8Eb55IfMG0a37XU= github.com/getlantern/quicwrapper v0.0.0-20240229232335-e6b4c3c30b2f/go.mod h1:V1d6sFYfulYYs07QS2pzBkpuQiF2Jj12KepiT3LFytY= +github.com/getlantern/ratelimit v0.0.0-20220926192648-933ab81a6fc7 h1:47FJ5kTeXc3I1VPpi2hWW9I16/Y3K0cpUq/B7oWJGF8= github.com/getlantern/ratelimit v0.0.0-20220926192648-933ab81a6fc7/go.mod h1:OOqKCIkspqXtIWEex4uhH1H9l7NGekT9i3Hs591ZDk4= github.com/getlantern/replica v0.14.5-0.20240909174421-21691d4b40f8 h1:K+zi+42bkdPfyE9ZoGpDWocUzLfIGajmHTIvbippeX8= github.com/getlantern/replica v0.14.5-0.20240909174421-21691d4b40f8/go.mod h1:EGZQzNcxXFE6/C4hM6+91fDZz9hOQ0GZHdzNne3k/Oc= @@ -377,16 +422,21 @@ github.com/getlantern/rot13 v0.0.0-20220822172233-370767b2f782 h1:A1+qM0Dqm0no8A github.com/getlantern/rot13 v0.0.0-20220822172233-370767b2f782/go.mod h1:O0dNqH9hbXlOa9OpVdbACmTBfDPD+ENjbY0cPkzBd9g= github.com/getlantern/rotator v0.0.0-20160829164113-013d4f8e36a2 h1:smFR/kESUKlcdyatoOO3HngBzzrUU6S0LRw2vCBYQPg= github.com/getlantern/rotator v0.0.0-20160829164113-013d4f8e36a2/go.mod h1:Ap+QTDJeA24+0jjPHReq/LyP3ugEEDYvncluEgsm60A= +github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627 h1:eYXtxjRyiP9f1rMvbnyT4DBWFEiIPY3zzMA5KqVshyc= github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627/go.mod h1:QJUudepmTj/KQXnReV6DZSJY/xO05fnfcZf3t8zkNLg= github.com/getlantern/shortcut v0.0.0-20211026183428-bf59a137fdec h1:8TfjIMydnhBs4edmXu2Nz1f2P0QOcXfol2rR1cxfrSs= github.com/getlantern/shortcut v0.0.0-20211026183428-bf59a137fdec/go.mod h1:3VQ6qvEBehqDBNbEKfNtSjK6MR5ydOdjMPgKjKay7vo= +github.com/getlantern/sysproxy v0.0.0-20240711003440-384834c7b4cb h1:9eaFCu1MZ5yp1vpg6KNOkjTzQnfo2MAbgqOqL/AnmAw= github.com/getlantern/sysproxy v0.0.0-20240711003440-384834c7b4cb/go.mod h1:sIaf1EQGv8d+l71iPiFYiLJtBp9fRy5wgO3mTFXSPzM= +github.com/getlantern/telemetry v0.0.0-20230523155019-be7c1d8cd8cb h1:6XZ3Q4oD6A1Tjq6QLgzzQrdQ8FvulzW16HhNQOSECAM= github.com/getlantern/telemetry v0.0.0-20230523155019-be7c1d8cd8cb/go.mod h1:nGOdDc0aD/LRTaY2SGKQ7nsYcWFXrhgkrhIhJuYN614= +github.com/getlantern/testify v0.0.0-20160317154340-2eeb3906e78f h1:R6iv+VzCrbxlBm2TcgyJi9c7tQguNXi9JmIvuUJKrdc= github.com/getlantern/testify v0.0.0-20160317154340-2eeb3906e78f/go.mod h1:uKKI9HSwZ4C8tx1vV+ovbG32Lw9LixtzPLNiS8U/ddA= github.com/getlantern/timezone v0.0.0-20210901200113-3f9de9d360c9 h1:VTNjZxSuAHUzu13lYpEVB8gc3xz5hZePGNHG5enHYLY= github.com/getlantern/timezone v0.0.0-20210901200113-3f9de9d360c9/go.mod h1:7uvbzuoOr3uYGHZx5QWlI8/C52XEf/aTb/tJFEe41Ak= github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461 h1:3HOWV/uUGde6whvG7aoxIQlL43jHkmPupJsDCA569u0= github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461/go.mod h1:ZLyPOKtNWU4vWnAiRiNQ7hbfLMqCEuj1DgQWBtHp7tQ= +github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4 h1:73U3J4msGw3cXeKtCEbY7hbOdD6aX8gJv8BOu+VagF8= github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4/go.mod h1:f8WmDYKFOaC5/y0d3GWl6UKf1ZbSlIoMzkuC8x7pUhg= github.com/getlantern/tlsdialer/v3 v3.0.3 h1:OXzzAqO8YojBOu2Kk8wquX2zbFmgJjji41RpaT6knLg= github.com/getlantern/tlsdialer/v3 v3.0.3/go.mod h1:hwA0X81pnrgx7GEwddaGWSxqr6eLBm7A0rrUMK2J7KY= @@ -398,9 +448,13 @@ github.com/getlantern/tlsutil v0.2.0/go.mod h1:Vxsyr9DVnYwsqHaEzMYkg9fT8aBrnO2eI github.com/getlantern/tlsutil v0.5.3 h1:g1FjuG4/OTZe8kkbEmpSxvT9rXzYOG9jO4jHiDeQIxM= github.com/getlantern/tlsutil v0.5.3/go.mod h1:lVgvr4nxuQ1ocOho90UB6LnHFlpP16TXAGpHR8Z0QnI= github.com/getlantern/uuid v1.1.2-0.20190507182000-5c9436b8c718/go.mod h1:uX10hOzZUUDR+oYNSIks+RcozOEiwTNC/K2rw9SUi1k= +github.com/getlantern/uuid v1.2.0 h1:pGrGaCV7XEaG6lvjWkwf8Y92BjB/9yFmkKsNFpRQ7rc= github.com/getlantern/uuid v1.2.0/go.mod h1:uX10hOzZUUDR+oYNSIks+RcozOEiwTNC/K2rw9SUi1k= +github.com/getlantern/waitforserver v1.0.1 h1:xBjqJ3GgEk9JMWnDgRSiNHXINi6Lv2tGNjJR0hCkHFY= github.com/getlantern/waitforserver v1.0.1/go.mod h1:K1oSA8lNKgQ9iC00OFpMfMNm4UMrsxoGCdHf0NT9LGs= +github.com/getlantern/winsvc v0.0.0-20160824205134-8bb3a5dbcc1d h1:ptkLncSALmQuD24bNB6TIBvWQ2q1XpUs0HzqE9f+RJs= github.com/getlantern/winsvc v0.0.0-20160824205134-8bb3a5dbcc1d/go.mod h1:bbt0iMT4LOQxNCEtmxJmPtNZk+mRp0CXkqK9kab/0r4= +github.com/getlantern/withtimeout v0.0.0-20160829163843-511f017cd913 h1:YK3YNyTsa+1BPWOoN0F79rrjHyfNx4MAoFEvzwQU+dY= github.com/getlantern/withtimeout v0.0.0-20160829163843-511f017cd913/go.mod h1:bwttrA0oacoHdL476F60prypY1oC++WLtVexumgZozY= github.com/getlantern/yaml v0.0.0-20190801163808-0c9bb1ebf426 h1:lb2OElfhZzfgvNQym79ONvv4yvDh/gShHkLQI6qzriA= github.com/getlantern/yaml v0.0.0-20190801163808-0c9bb1ebf426/go.mod h1:SoTXbOvaDC1bH3QrlkU5kz/h12tU/hN54wSMUCdgEXs= @@ -431,8 +485,11 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw= github.com/go-ping/ping v1.1.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= github.com/go-stack/stack v1.6.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -440,6 +497,8 @@ github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= +github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -454,6 +513,7 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20170918230701-e5d664eb928e/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -467,6 +527,7 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -490,6 +551,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= +github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -501,6 +564,7 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190309154008-847fc94819f9/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -521,6 +585,8 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -530,20 +596,28 @@ github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackpal/gateway v1.0.13 h1:fJccMvawxx0k7S1q7Fy/SXFE0R3hMXkMuw8y9SofWAk= github.com/jackpal/gateway v1.0.13/go.mod h1:6c8LjW+FVESFmwxaXySkt7fU98Yv806ADS3OY6Cvh2U= github.com/jaffee/commandeer v0.6.0 h1:YI44XLWcJN21euhh32sZW8vM/tljPYxhsXIfEPkQKcs= github.com/jaffee/commandeer v0.6.0/go.mod h1:kCwfuSvZ2T0NVEr3LDSo6fDUgi0xSBnAVDdkOKTtpLQ= github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= +github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4 h1:nwOc1YaOrYJ37sEBrtWZrdqzK22hiJs3GpDmP3sR2Yw= github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kataras/golog v0.1.9 h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk= +github.com/kataras/golog v0.1.9/go.mod h1:jlpk/bOaYCyqDqH18pgDHdaJab72yBE6i0O3s30hpWY= +github.com/kataras/pio v0.0.12 h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w= +github.com/kataras/pio v0.0.12/go.mod h1:ODK/8XBhhQ5WqrAhKy+9lTPS7sBf6O3KcLhc9klfRcY= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -555,10 +629,12 @@ github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ib github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.12.3 h1:tzUznbfc3OFwJaTebv/QdhnFf2Xvb7gZ24XaHLBPmdc= github.com/klauspost/reedsolomon v1.12.3/go.mod h1:3K5rXwABAvzGeR01r6pWZieUALXO/Tq7bFKGIb4m4WI= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/binarydist v0.1.0 h1:6kAoLA9FMMnNGSehX0s1PdjbEaACznAv/W219j2uvyo= github.com/kr/binarydist v0.1.0/go.mod h1:DY7S//GCoz1BCd0B0EVrinCKAZN3pXe+MDaIZbXQVgM= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -570,8 +646,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leekchan/accounting v1.0.0 h1:+Wd7dJ//dFPa28rc1hjyy+qzCbXPMR91Fb6F1VGTQHg= github.com/leekchan/accounting v1.0.0/go.mod h1:3timm6YPhY3YDaGxl0q3eaflX0eoSx3FXn7ckHe4tO0= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -582,15 +660,20 @@ github.com/mattn/go-colorable v0.0.10-0.20170816031813-ad5389df28cd/go.mod h1:9v github.com/mattn/go-isatty v0.0.2/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v2.0.2+incompatible h1:qzw9c2GNT8UFrgWNDhCTqRqYUSmu/Dav/9Z58LGpk7U= github.com/mattn/go-sqlite3 v2.0.2+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= +github.com/mdlayher/netlink v1.1.0 h1:mpdLgm+brq10nI9zM1BpX1kpDbh3NLl3RSnVq6ZSkfg= github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= +github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= +github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs= github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= @@ -605,7 +688,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -622,25 +707,40 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nwaples/rardecode v1.1.2 h1:Cj0yZY6T1Zx1R7AhTbyGSALm44/Mmq+BAPc4B/p/d3M= github.com/nwaples/rardecode v1.1.2/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrzN7IgKZc= github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y= +github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs= github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= +github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= +github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pion/datachannel v1.5.8 h1:ph1P1NsGkazkjrvyMfhRBUAWMxugJjq2HfQifaOoSNo= github.com/pion/datachannel v1.5.8/go.mod h1:PgmdpoaNBLX9HNzNClmdki4DYW5JtI7Yibu8QzbL3tI= github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= @@ -685,6 +785,8 @@ github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLh github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= +github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= +github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= github.com/pion/turn v1.3.5/go.mod h1:zGPB7YYB/HTE9MWn0Sbznz8NtyfeVeanZ834cG/MXu0= github.com/pion/turn v1.4.0 h1:7NUMRehQz4fIo53Qv9ui1kJ0Kr1CA82I81RHKHCeM80= github.com/pion/turn v1.4.0/go.mod h1:aDSi6hWX/hd1+gKia9cExZOR0MU95O7zX9p3Gw/P2aU= @@ -693,6 +795,8 @@ github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= github.com/pion/webrtc/v3 v3.3.4 h1:v2heQVnXTSqNRXcaFQVOhIOYkLMxOu1iJG8uy1djvkk= github.com/pion/webrtc/v3 v3.3.4/go.mod h1:liNa+E1iwyzyXqNUwvoMRNQ10x8h8FOeJKL8RkIbamE= +github.com/pivotal-cf-experimental/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:AbOpFa7UXCGaV+aq9tvFdSHEhmcb8uO6nKZdYhKsT1I= +github.com/pivotal-cf-experimental/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:4+wzrM70C+Ky5iZiA6lNV5J48jnGmu8YcbmuVWdlt5s= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -743,6 +847,7 @@ github.com/refraction-networking/wazero v1.7.1-w h1:z7Ty5PsMkJEDBCsn3ELUjceQGBT0 github.com/refraction-networking/wazero v1.7.1-w/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg= github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -759,19 +864,27 @@ github.com/samber/lo v1.46.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5 github.com/shadowsocks/go-shadowsocks2 v0.1.5 h1:PDSQv9y2S85Fl7VBeOMF9StzeXZyK1HakRm86CUbr28= github.com/shadowsocks/go-shadowsocks2 v0.1.5/go.mod h1:AGGpIoek4HRno4xzyFiAtLHkOpcoznZEkAccaI/rplM= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/songgao/water v0.0.0-20190725173103-fd331bda3f4b/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E= +github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 h1:TG/diQgUe0pntT/2D9tmUCz4VNwm9MfrtPr0SU2qSX8= github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -785,6 +898,8 @@ github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1: github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -792,6 +907,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -807,12 +923,15 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/templexxx/cpu v0.1.1 h1:isxHaxBXpYFWnk2DReuKkigaZyrjs2+9ypIdGP4h+HI= github.com/templexxx/cpu v0.1.1/go.mod h1:w7Tb+7qgcAlIyX4NhLuDKt78AHA5SzPmq0Wj6HiEnnk= github.com/templexxx/xorsimd v0.4.3 h1:9AQTFHd7Bhk3dIT7Al2XeBX5DWOvsUPZCuhyAtNbHjU= github.com/templexxx/xorsimd v0.4.3/go.mod h1:oZQcD6RFDisW2Am58dSAGwwL6rHjbzrlu25VDqfWkQg= +github.com/ti-mo/conntrack v0.3.0 h1:572/72R9la2FVvO6CbsLiCmR48U3pgCvIlLKoUrExDU= github.com/ti-mo/conntrack v0.3.0/go.mod h1:tPSYNx21TnjxGz99pLD/lAN4fuEViaJZz+pliMqnovk= +github.com/ti-mo/netfilter v0.3.1 h1:+ZTmeTx+64Jw2N/1gmqm42kruDWjQ90SMjWEB1e6VDs= github.com/ti-mo/netfilter v0.3.1/go.mod h1:t/5HvCCHA1LAYj/AZF2fWcJ23BQTA7lzTPCuwwi7xQY= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= @@ -828,22 +947,32 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= +github.com/vishvananda/netns v0.0.1 h1:JDkWS7Axy5ziNM3svylLhpSgqjPDb+BgVUbXoDo+iPw= +github.com/vishvananda/netns v0.0.1/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vulcand/oxy v1.4.2 h1:KibUVdKrwy7eXR3uHS2pYoZ9dCzKVcgDNHD2jkPZmxU= +github.com/vulcand/oxy v1.4.2/go.mod h1:Yq8OBb0XWU/7nPSglwUH5LS2Pcp4yvad8SVayobZbSo= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/wlynxg/anet v0.0.3 h1:PvR53psxFXstc12jelG6f1Lv4MWqE0tI76/hHGjh9rg= github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= +github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E= +github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0= github.com/xtaci/smux v1.5.10/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= github.com/xtaci/smux v1.5.27 h1:uIU1dpJQQWUCmGxXBgajLfc8cMMb13hCitj+HC5yC/Q= github.com/xtaci/smux v1.5.27/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb h1:qRSZHsODmAP5qDvb3YsO7Qnf3TRiVbGxNG/WYnlM4/o= gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb/go.mod h1:gvdJuZuO/tPZyhEV8K3Hmoxv/DWud5L4qEQxfYjEUTo= +gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d h1:tJ8F7ABaQ3p3wjxwXiWSktVDgjZEXkvaRawd2rIq5ws= gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d/go.mod h1:9GcM8QNU9/wXtEEH2q8bVOnPI7FtIF6VVLzZ1l6Hgf8= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= @@ -851,10 +980,13 @@ go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 h1:ZtfnDL+tUrs1F0Pzfwbg2d59Gru9NCH3bgSHBM6LDwU= go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 h1:wNMDy/LVGLj2h3p6zg4d0gypKfWKSWI14E1C4smOgl8= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0/go.mod h1:YfbDdXAAkemWJK3H/DshvlrxqFB2rtW4rY6ky/3x/H0= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= @@ -864,6 +996,7 @@ go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGX go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= @@ -874,6 +1007,8 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -913,6 +1048,7 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20241016134751-7ff83004ec2c h1:zuNS/LWsEpPTLfrmBkis6Xofw3nieAqB4hYLn8+uswk= golang.org/x/mobile v0.0.0-20241016134751-7ff83004ec2c/go.mod h1:snk1Mn2ZpdKCt90JPEsDh4sL3ReK520U2t0d7RHBnSU= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= @@ -1112,9 +1248,12 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1131,6 +1270,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gvisor.dev/gvisor v0.0.0-20240912010154-1243db29d375 h1:wLcac6WGtl2F79rF0Rr0uHbwxfPry99Nuqp1cEo4JQo= gvisor.dev/gvisor v0.0.0-20240912010154-1243db29d375/go.mod h1:sxc3Uvk/vHcd3tj7/DHVBoR5wvWT/MmRq2pj7HRJnwU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1139,14 +1279,31 @@ howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= +modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.20.7 h1:skrinQsjxWfvj6nbC3ztZPJy+NuwmB3hV9zX/pthNYQ= +modernc.org/ccgo/v4 v4.20.7/go.mod h1:UOkI3JSG2zT4E2ioHlncSOZsXbuDCZLvPi3uMlZT5GY= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= +modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/libc v1.59.1 h1:ZVsgtxNu5OyIsX0Qq6T4aN7IxP1YTmvKZuf8T5fV0Ro= modernc.org/libc v1.59.1/go.mod h1:EY/egGEU7Ju66eU6SBqCNYaFUDuc4npICkMWnU5EE3A= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= modernc.org/sqlite v1.32.0 h1:6BM4uGza7bWypsw4fdLRsLxut6bHe4c58VeqjRgST8s= modernc.org/sqlite v1.32.0/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y= nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= zombiezen.com/go/sqlite v1.3.0 h1:98g1gnCm+CNz6AuQHu0gqyw7gR2WU3O3PJufDOStpUs= zombiezen.com/go/sqlite v1.3.0/go.mod h1:yRl27//s/9aXU3RWs8uFQwjkTG9gYNGEls6+6SvrclY= From b742df5635c2d6d2731025ea208444dbe6d21d31 Mon Sep 17 00:00:00 2001 From: atavism Date: Sun, 1 Dec 2024 08:20:58 -0800 Subject: [PATCH 15/23] Remove old tests --- internalsdk/user_test.go | 52 ---------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 internalsdk/user_test.go diff --git a/internalsdk/user_test.go b/internalsdk/user_test.go deleted file mode 100644 index 65df20729..000000000 --- a/internalsdk/user_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package internalsdk - -import ( - "context" - "testing" - - "github.com/getlantern/errors" - "github.com/getlantern/lantern-client/internalsdk/mocks" - "github.com/getlantern/lantern-client/internalsdk/pro" - "github.com/getlantern/lantern-client/internalsdk/protos" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" -) - -func TestCreateUser_Success(t *testing.T) { - mockClient := new(mocks.ProClient) - mockSession := new(mocks.ClientSession) - - // Set up expected behavior - mockClient.On("UserCreate", mock.Anything).Return(&pro.UserDataResponse{ - User: &protos.User{ - UserId: 123, - Token: "test-token", - }, - }, nil) - mockClient.On("SetUserIDAndToken", int64(123), "test-token").Return(nil) - - _, err := mockClient.UserCreate(context.Background()) - assert.NoError(t, err, "expected no error") - // Verify that UserCreate and SetUserIdAndToken were called once - mockClient.AssertCalled(t, "UserCreate", mock.Anything) - mockSession.AssertCalled(t, "SetUserIDAndToken", int64(123), "test-token") -} - -func TestCreateUser_Failure(t *testing.T) { - mockClient := new(mocks.ProClient) - - mockClient.On("UserCreate", mock.Anything).Return(nil, errors.New("failed to create user")) - - _, err := mockClient.UserCreate(context.Background()) - assert.Error(t, err, "expected an error") - mockClient.AssertCalled(t, "UserCreate", mock.Anything) -} - -type mockClient struct { - mock.Mock -} - -func (m *mockClient) UpdateUserData(ctx context.Context, session pro.ClientSession) (interface{}, error) { - args := m.Called(ctx, session) - return args.Get(0), args.Error(1) -} From b9dc679fb986ec958dd7070a58cffb6eb7530b3b Mon Sep 17 00:00:00 2001 From: atavism Date: Mon, 2 Dec 2024 08:04:43 -0800 Subject: [PATCH 16/23] Stop polling if user becomes pro and some other clean-ups --- internalsdk/pro/user.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index e6ae3bb4b..88182eb37 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -133,10 +133,6 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, // Add jitter to backoff interval expBackoff.RandomizationFactor = 0.5 - if _, err := client.UpdateUserData(ctx, session); err != nil { - log.Errorf("Initial user data update failed: %v", err) - } - timer := time.NewTimer(expBackoff.NextBackOff()) defer timer.Stop() @@ -146,7 +142,7 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, log.Errorf("Poll user data cancelled: %v", ctx.Err()) return case <-timer.C: - _, err := client.UpdateUserData(ctx, session) + user, err := client.UpdateUserData(ctx, session) if err != nil { if ctx.Err() != nil { log.Errorf("UpdateUserData terminated due to context: %v", ctx.Err()) @@ -155,11 +151,19 @@ func (c *proClient) PollUserData(ctx context.Context, session ClientSession, log.Errorf("UpdateUserData failed: %v", err) } + userIsPro := func(u *protos.User) bool { + return u != nil && (u.UserLevel == "pro" || u.UserStatus == "active") + } + + if userIsPro(user) { + log.Debug("User became Pro. Stopping polling.") + return + } + // Get the next backoff interval waitTime := expBackoff.NextBackOff() if waitTime == backoff.Stop { log.Debug("Exponential backoff reached max elapsed time. Exiting...") - timer.Stop() return } timer.Reset(waitTime) From 16f1ad7ade867b2122012072996ff70f02e6ba2c Mon Sep 17 00:00:00 2001 From: jigar-f <132374182+jigar-f@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:27:14 +0530 Subject: [PATCH 17/23] Fix user create api on android. (#1246) * Fix user create api on android. * Fix desktop build issue. --- desktop/app/app.go | 39 +++++++++++++++++++++++++++++++++-- desktop/lib.go | 2 +- desktop/settings/settings.go | 5 +++++ internalsdk/android.go | 10 ++++----- internalsdk/pro/user.go | 40 ++++++++++++++++++++++-------------- internalsdk/session_model.go | 37 ++++++++++++++++++++------------- 6 files changed, 96 insertions(+), 37 deletions(-) diff --git a/desktop/app/app.go b/desktop/app/app.go index 0e1f3be1a..39d3f948e 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -571,9 +571,9 @@ func (app *App) fetchOrCreateUser(ctx context.Context) { } if userID := ss.GetUserID(); userID == 0 { ss.SetUserFirstVisit(true) - app.proClient.RetryCreateUser(ctx, ss, 5*time.Minute) + app.proClient.RetryCreateUser(ctx, app, 5*time.Minute) } else { - app.proClient.UpdateUserData(ctx, ss) + app.proClient.UpdateUserData(ctx, app) } } @@ -627,6 +627,7 @@ func (app *App) GetPaymentMethods(ctx context.Context) ([]protos.PaymentMethod, } // FetchPaymentMethods returns the plans and payment plans available to a user +// Updates cache with the fetched data func (app *App) FetchPaymentMethods(ctx context.Context) (*proclient.PaymentMethodsResponse, error) { resp, err := app.proClient.PaymentMethodsV4(context.Background()) if err != nil { @@ -728,3 +729,37 @@ func (app *App) ProClient() pro.ProClient { defer app.mu.RUnlock() return app.proClient } + +// Client session methods +func (app *App) FetchUserData() error { + go app.FetchPaymentMethods(context.Background()) + return nil +} + +func (app *App) GetDeviceID() (string, error) { + return app.Settings().GetDeviceID(), nil +} + +func (app *App) GetUserFirstVisit() (bool, error) { + return app.Settings().GetUserFirstVisit(), nil +} + +func (app *App) SetUserIDAndToken(id int64, token string) error { + app.Settings().SetUserIDAndToken(id, token) + return nil +} + +func (app *App) SetProUser(pro bool) error { + app.Settings().SetProUser(pro) + return nil +} + +func (app *App) SetReferralCode(referral string) error { + app.Settings().SetReferralCode(referral) + return nil +} + +func (app *App) SetExpiration(exp int64) error { + app.Settings().SetExpiration(exp) + return nil +} diff --git a/desktop/lib.go b/desktop/lib.go index e01fbf7c6..888fd6c0b 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -150,7 +150,7 @@ func setProxyAll(value *C.char) { func hasPlanUpdatedOrBuy() *C.char { ctx := context.Background() proClient := a.ProClient() - go proClient.PollUserData(ctx, a.Settings(), 10*time.Minute, proClient) + go proClient.PollUserData(ctx, a, 10*time.Minute, proClient) //Get the cached user data log.Debugf("DEBUG: Checking if user has updated plan or bought new plan") cacheUserData, isOldFound := cachedUserData() diff --git a/desktop/settings/settings.go b/desktop/settings/settings.go index ffb29c6e6..0f405d425 100644 --- a/desktop/settings/settings.go +++ b/desktop/settings/settings.go @@ -620,6 +620,11 @@ func (s *Settings) GetToken() string { return s.getString(SNUserToken) } +// GetToken returns the user token +func (s *Settings) FetchUserData() error { + return nil +} + // GetMigratedDeviceIDForUserID returns the user ID (if any) for which the current device's ID has been migrated from the old style to the new style func (s *Settings) GetMigratedDeviceIDForUserID() int64 { return s.getInt64(SNMigratedDeviceIDForUserID) diff --git a/internalsdk/android.go b/internalsdk/android.go index 0d5a7fd59..5d9b60a36 100644 --- a/internalsdk/android.go +++ b/internalsdk/android.go @@ -710,11 +710,11 @@ func geoLookup(session PanickingSession) { func afterStart(wrappedSession Session, session PanickingSession) { - if session.GetUserID() == 0 { - ctx := context.Background() - proClient := createProClient(wrappedSession, "android") - go proClient.RetryCreateUser(ctx, session, 10*time.Minute) - } + // if session.GetUserID() == 0 { + // ctx := context.Background() + // proClient := createProClient(wrappedSession, "android") + // go proClient.RetryCreateUser(ctx, session, 10*time.Minute) + // } bandwidthUpdates(session) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index 88182eb37..b90f25651 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -10,21 +10,23 @@ import ( "github.com/getlantern/lantern-client/internalsdk/protos" ) -// UserConfig represents the minimal configuration necessary for a client session -type UserConfig interface { - GetDeviceID() string - GetUserFirstVisit() bool - GetUserID() int64 - GetToken() string - Locale() string -} +// // UserConfig represents the minimal configuration necessary for a client session +// type UserConfig interface { +// GetDeviceID() string +// GetUserFirstVisit() bool +// GetUserID() int64 +// GetToken() string +// Locale() string +// } type ClientSession interface { - UserConfig - SetExpiration(int64) - SetProUser(bool) - SetReferralCode(string) - SetUserIDAndToken(int64, string) + SetExpiration(int64) error + SetProUser(bool) error + SetReferralCode(string) error + SetUserIDAndToken(int64, string) error + FetchUserData() error + GetDeviceID() (string, error) + GetUserFirstVisit() (bool, error) } type backoffRunner struct { @@ -45,6 +47,7 @@ func (c *proClient) createUser(ctx context.Context, session ClientSession) error } session.SetReferralCode(user.Referral) session.SetUserIDAndToken(user.UserId, user.Token) + session.FetchUserData() return nil } @@ -72,7 +75,10 @@ func (c *proClient) UpdateUserData(ctx context.Context, ss ClientSession) (*prot return nil, errors.New("error fetching user data") } user := resp.User - currentDevice := ss.GetDeviceID() + currentDevice, err := ss.GetDeviceID() + if err != nil { + return nil, log.Errorf("error fetching device id: %v", err) + } // Check if device id is connect to same device if not create new user // this is for the case when user removed device from other device @@ -86,7 +92,11 @@ func (c *proClient) UpdateUserData(ctx context.Context, ss ClientSession) (*prot } } /// Check if user has installed app first time - firstTime := ss.GetUserFirstVisit() + firstTime, err := ss.GetUserFirstVisit() + if err != nil { + return nil, log.Errorf("error fetching user first visit: %v", err) + } + log.Debugf("First time visit %v", firstTime) if user.UserLevel == "pro" && firstTime { log.Debugf("User is pro and first time") diff --git a/internalsdk/session_model.go b/internalsdk/session_model.go index f2c021ed1..f7dc06b46 100644 --- a/internalsdk/session_model.go +++ b/internalsdk/session_model.go @@ -188,6 +188,7 @@ func NewSessionModel(mdb minisql.DB, opts *SessionModelOpts) (*SessionModel, err if opts.Platform == "ios" { go m.setupIosConfigure(opts.ConfigPath, int(userID), token, deviceID) } + log.Debugf("SessionModel initialized") go m.initSessionModel(context.Background(), opts) return m, nil } @@ -739,25 +740,27 @@ func (m *SessionModel) initSessionModel(ctx context.Context, opts *SessionModelO pathdb.Mutate(m.db, func(tx pathdb.TX) error { return pathdb.Put(tx, pathIsFirstTime, true, "") }) - err = m.userCreate(ctx) + + // err = m.userCreate(ctx) + // if err != nil { + // log.Error(err) + // } + go m.proClient.RetryCreateUser(ctx, m, 10*time.Minute) + } else { + // Get all user details + err = m.userDetail(ctx) if err != nil { log.Error(err) } - } - // Get all user details - err = m.userDetail(ctx) - if err != nil { - log.Error(err) + go func() { + err = m.paymentMethods() + if err != nil { + log.Debugf("Plans V3 error: %v", err) + // return err + } + }() } - - go func() { - err = m.paymentMethods() - if err != nil { - log.Debugf("Plans V3 error: %v", err) - // return err - } - }() go checkSplitTunneling(m) m.surveyModel, _ = NewSurveyModel(*m) return nil @@ -1364,6 +1367,12 @@ func (m *SessionModel) SetUserIDAndToken(p1 int64, p2 string) error { return pathdb.Put(tx, pathToken, p2, "") }) } + +func (m *SessionModel) FetchUserData() error { + m.proClient.UserData(context.Background()) + return m.paymentMethods() +} + func setResellerCode(m *baseModel, resellerCode string) error { return pathdb.Mutate(m.db, func(tx pathdb.TX) error { return pathdb.Put(tx, pathResellerCode, resellerCode, "") From a5e31d0b0c01c42de235c113342d4466a9a45889 Mon Sep 17 00:00:00 2001 From: atavism Date: Wed, 4 Dec 2024 11:38:24 -0800 Subject: [PATCH 18/23] Add back auth methods for now --- desktop/auth.go | 10 +++++++++- internalsdk/pro/user.go | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop/auth.go b/desktop/auth.go index 944172eba..473a8d651 100644 --- a/desktop/auth.go +++ b/desktop/auth.go @@ -128,6 +128,10 @@ func logout() *C.char { } clearLocalUserData() + // Create new user + if _, err := a.ProClient().UserCreate(ctx); err != nil { + return sendError(err) + } return C.CString("true") } @@ -295,7 +299,7 @@ func deleteAccount(password *C.char) *C.char { if err != nil { return sendError(err) } - log.Debugf("Account Delted response %v", isAccountDeleted) + log.Debugf("Account deleted response %v", isAccountDeleted) if !isAccountDeleted { return sendError(log.Errorf("user_not_found error while deleting account %v", err)) @@ -305,5 +309,9 @@ func deleteAccount(password *C.char) *C.char { clearLocalUserData() // Set user id and token to nil a.Settings().SetUserIDAndToken(0, "") + // Create new user + if _, err := a.ProClient().UserCreate(ctx); err != nil { + return sendError(err) + } return C.CString("true") } diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index b90f25651..c733f45f5 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -34,6 +34,8 @@ type backoffRunner struct { isRunning bool } +// createUser submits a request to create a new user with the Pro user and +// configures a new client session func (c *proClient) createUser(ctx context.Context, session ClientSession) error { log.Debug("New user, calling user create") resp, err := c.UserCreate(ctx) From 4252f78daa67f7e1f9f6dc977f76a05bec2a7405 Mon Sep 17 00:00:00 2001 From: atavism Date: Wed, 4 Dec 2024 13:59:25 -0800 Subject: [PATCH 19/23] move plans and payment methods calls to pro client --- desktop/app/app.go | 71 ++--------------------------------------- desktop/app/config.go | 4 +-- desktop/auth.go | 2 +- internalsdk/pro/pro.go | 30 +++-------------- internalsdk/pro/user.go | 3 +- 5 files changed, 12 insertions(+), 98 deletions(-) diff --git a/desktop/app/app.go b/desktop/app/app.go index 8a1000b8b..6ea041328 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -87,7 +87,6 @@ type App struct { ws ws.UIChannel cachedUserData sync.Map - plansCache sync.Map onUserData []func(current *protos.User, new *protos.User) @@ -384,7 +383,7 @@ func (app *App) OnStatsChange(fn func(stats.Stats)) { func (app *App) afterStart(cl *flashlightClient.Client) { ctx := context.Background() go app.fetchOrCreateUser(ctx) - go app.GetPaymentMethods(ctx) + go app.proClient.DesktopPaymentMethods(ctx) go app.fetchDeviceLinkingCode(ctx) app.OnSettingChange(settings.SNSystemProxy, func(val interface{}) { @@ -601,72 +600,6 @@ func (app *App) fetchDeviceLinkingCode(ctx context.Context) (string, error) { return resp.Code, nil } -// Plans returns the plans available to a user -func (app *App) Plans(ctx context.Context) ([]protos.Plan, error) { - if v, ok := app.plansCache.Load("plans"); ok { - resp := v.([]protos.Plan) - log.Debugf("Returning plans from cache %s", v) - return resp, nil - } - resp, err := app.FetchPaymentMethods(ctx) - if err != nil { - return nil, err - } - return resp.Plans, nil -} - -// GetPaymentMethods returns the plans and payment from cache if available -// if not then call FetchPaymentMethods -func (app *App) GetPaymentMethods(ctx context.Context) ([]protos.PaymentMethod, error) { - if v, ok := app.plansCache.Load("paymentMethods"); ok { - resp := v.([]protos.PaymentMethod) - log.Debugf("Returning payment methods from cache %s", v) - return resp, nil - } - resp, err := app.FetchPaymentMethods(ctx) - if err != nil { - return nil, err - } - desktopProviders, ok := resp.Providers["desktop"] - if !ok { - return nil, errors.New("No desktop payment providers found") - } - return desktopProviders, nil -} - -// FetchPaymentMethods returns the plans and payment plans available to a user -// Updates cache with the fetched data -func (app *App) FetchPaymentMethods(ctx context.Context) (*proclient.PaymentMethodsResponse, error) { - resp, err := app.proClient.PaymentMethodsV4(context.Background()) - if err != nil { - return nil, errors.New("Could not get payment methods: %v", err) - } - desktopPaymentMethods, ok := resp.Providers["desktop"] - if !ok { - return nil, errors.New("No desktop payment providers found") - } - for i := range desktopPaymentMethods { - paymentMethod := &desktopPaymentMethods[i] - for j, provider := range paymentMethod.Providers { - if resp.Logo[provider.Name] != nil { - logos := resp.Logo[provider.Name].([]interface{}) - for _, logo := range logos { - paymentMethod.Providers[j].LogoUrls = append(paymentMethod.Providers[j].LogoUrls, logo.(string)) - } - } - } - } - //clear previous store cache - app.plansCache.Delete("plans") - app.plansCache.Delete("paymentMethods") - log.Debugf("DEBUG: Payment methods plans: %+v", resp.Plans) - log.Debugf("DEBUG: Payment methods providers: %+v", desktopPaymentMethods) - app.plansCache.Store("plans", resp.Plans) - app.plansCache.Store("paymentMethods", desktopPaymentMethods) - app.sendConfigOptions() - return resp, nil -} - func (app *App) devices() protos.Devices { user, found := app.GetUserData(app.Settings().GetUserID()) @@ -741,7 +674,7 @@ func (app *App) ProClient() proclient.ProClient { // Client session methods func (app *App) FetchUserData() error { - go app.FetchPaymentMethods(context.Background()) + go app.proClient.PaymentMethodsCache(context.Background()) return nil } diff --git a/desktop/app/config.go b/desktop/app/config.go index 9e2363ae4..dbeb6c1b8 100644 --- a/desktop/app/config.go +++ b/desktop/app/config.go @@ -84,8 +84,8 @@ func (app *App) sendConfigOptions() { return authEnabled } ctx := context.Background() - plans, _ := app.Plans(ctx) - paymentMethods, _ := app.GetPaymentMethods(ctx) + plans, _ := app.proClient.Plans(ctx) + paymentMethods, _ := app.proClient.DesktopPaymentMethods(ctx) devices, _ := json.Marshal(app.devices()) log.Debugf("DEBUG: Devices: %s", string(devices)) log.Debugf("Expiration date: %s", app.settings.GetExpirationDate()) diff --git a/desktop/auth.go b/desktop/auth.go index 473a8d651..a603af3da 100644 --- a/desktop/auth.go +++ b/desktop/auth.go @@ -70,7 +70,7 @@ func signup(email *C.char, password *C.char) *C.char { saveUserSalt(salt) setting.SetEmailAddress(C.GoString(email)) a.SetUserLoggedIn(true) - a.FetchPaymentMethods(context.Background()) + a.ProClient().PaymentMethodsCache(context.Background()) return C.CString("true") } diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index ba65a83c0..64b06ae4f 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -6,6 +6,7 @@ import ( "fmt" "net/http" "strings" + "sync" "time" "github.com/getlantern/errors" @@ -29,6 +30,7 @@ var ( type proClient struct { webclient.RESTClient backoffRunner *backoffRunner + plansCache sync.Map userConfig func() common.UserConfig } @@ -40,10 +42,12 @@ type ProClient interface { webclient.RESTClient Client EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) + DesktopPaymentMethods(ctx context.Context) ([]protos.PaymentMethod, error) PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) - Plans(ctx context.Context) (*PlansResponse, error) + PaymentMethodsCache(ctx context.Context) (*PaymentMethodsResponse, error) + Plans(ctx context.Context) ([]protos.Plan, error) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration, client Client) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) @@ -191,30 +195,6 @@ func (c *proClient) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsRespon return &resp, nil } -// Plans is used to hit the legacy /plans endpoint. Deprecated. -func (c *proClient) Plans(ctx context.Context) (*PlansResponse, error) { - var resp PlansResponse - err := c.GetJSON(ctx, "/plans", c.defaultParams(), &resp) - if err != nil { - return nil, err - } - for i, plan := range resp.Plans { - parts := strings.Split(plan.Id, "-") - if len(parts) != 3 { - continue - } - cur := parts[1] - if currency, ok := accounting.LocaleInfo[strings.ToUpper(cur)]; ok { - if oneMonthCost, ok2 := plan.ExpectedMonthlyPrice[strings.ToLower(cur)]; ok2 { - ac := accounting.Accounting{Symbol: currency.ComSymbol, Precision: 2} - amount := decimal.NewFromInt(oneMonthCost).Div(decimal.NewFromInt(100)) - resp.Plans[i].OneMonthCost = ac.FormatMoneyDecimal(amount) - } - } - } - return &resp, nil -} - // UserCreate creates a new user func (c *proClient) UserCreate(ctx context.Context) (*UserDataResponse, error) { var resp UserDataResponse diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index c733f45f5..c07f7c375 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -43,10 +43,10 @@ func (c *proClient) createUser(ctx context.Context, session ClientSession) error return errors.New("Could not create new Pro user: %v", err) } user := resp.User - log.Debugf("DEBUG: User created: %v", user) if resp.BaseResponse != nil && resp.BaseResponse.Error != "" { return errors.New("Could not create new Pro user: %v", err) } + log.Debugf("Successfully created new user with id %d", user.UserId) session.SetReferralCode(user.Referral) session.SetUserIDAndToken(user.UserId, user.Token) session.FetchUserData() @@ -55,6 +55,7 @@ func (c *proClient) createUser(ctx context.Context, session ClientSession) error // RetryCreateUser is used to retry creating a user with an exponential backoff strategy func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration) { + log.Debug("Starting retry handler for user creation") expBackoff := backoff.NewExponentialBackOff() expBackoff.Multiplier = 2.0 expBackoff.InitialInterval = 3 * time.Second From 779d9cc9cde3379a131683dd24de8064104ce4c3 Mon Sep 17 00:00:00 2001 From: atavism Date: Wed, 4 Dec 2024 14:01:14 -0800 Subject: [PATCH 20/23] move plans and payment methods calls to pro client --- internalsdk/pro/plans.go | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 internalsdk/pro/plans.go diff --git a/internalsdk/pro/plans.go b/internalsdk/pro/plans.go new file mode 100644 index 000000000..b83c655f9 --- /dev/null +++ b/internalsdk/pro/plans.go @@ -0,0 +1,81 @@ +package pro + +import ( + "context" + + "github.com/getlantern/errors" + "github.com/getlantern/lantern-client/internalsdk/protos" +) + +// Plans returns the plans available to a user +func (c *proClient) Plans(ctx context.Context) ([]protos.Plan, error) { + if v, ok := c.plansCache.Load("plans"); ok { + resp := v.([]protos.Plan) + log.Debugf("Returning plans from cache %s", v) + return resp, nil + } + resp, err := c.PaymentMethodsCache(ctx) + if err != nil { + return nil, err + } + return resp.Plans, nil +} + +// DesktopPaymentMethods returns plans and payment methods available for desktop users +func (c *proClient) DesktopPaymentMethods(ctx context.Context) ([]protos.PaymentMethod, error) { + return c.paymentMethodsByPlatform(ctx, "desktop") +} + +// PaymentMethodsByPlatform returns the plans and payments from cache for the given platform +// if available; if not then call FetchPaymentMethods +func (c *proClient) paymentMethodsByPlatform(ctx context.Context, platform string) ([]protos.PaymentMethod, error) { + if platform != "desktop" && platform != "android" { + return nil, errors.New("invalid platform") + } + if v, ok := c.plansCache.Load("paymentMethods"); ok { + resp := v.([]protos.PaymentMethod) + log.Debugf("Returning payment methods from cache %s", v) + return resp, nil + } + resp, err := c.PaymentMethodsCache(ctx) + if err != nil { + return nil, err + } + desktopProviders, ok := resp.Providers["desktop"] + if !ok { + return nil, errors.New("No desktop payment providers found") + } + return desktopProviders, nil +} + +// PaymentMethodsCache returns the plans and payment plans available to a user +// Updates cache with the fetched data +func (c *proClient) PaymentMethodsCache(ctx context.Context) (*PaymentMethodsResponse, error) { + resp, err := c.PaymentMethodsV4(context.Background()) + if err != nil { + return nil, errors.New("Could not get payment methods: %v", err) + } + desktopPaymentMethods, ok := resp.Providers["desktop"] + if !ok { + return nil, errors.New("No desktop payment providers found") + } + for i := range desktopPaymentMethods { + paymentMethod := &desktopPaymentMethods[i] + for j, provider := range paymentMethod.Providers { + if resp.Logo[provider.Name] != nil { + logos := resp.Logo[provider.Name].([]interface{}) + for _, logo := range logos { + paymentMethod.Providers[j].LogoUrls = append(paymentMethod.Providers[j].LogoUrls, logo.(string)) + } + } + } + } + //clear previous store cache + c.plansCache.Delete("plans") + c.plansCache.Delete("paymentMethods") + log.Debugf("DEBUG: Payment methods plans: %+v", resp.Plans) + log.Debugf("DEBUG: Payment methods providers: %+v", desktopPaymentMethods) + c.plansCache.Store("plans", resp.Plans) + c.plansCache.Store("paymentMethods", desktopPaymentMethods) + return resp, nil +} From f6e67b73306da7fd206ca2ffdd7da7fdd73a1c3b Mon Sep 17 00:00:00 2001 From: Jigar-f Date: Thu, 5 Dec 2024 17:41:15 +0530 Subject: [PATCH 21/23] Fixed issue on desktop while creating user and other small fixes. --- desktop/app/app.go | 3 +- desktop/app/pro.go | 78 +++++++++++----------- desktop/auth.go | 2 +- desktop/settings/settings.go | 5 -- internalsdk/pro/plans.go | 8 +-- internalsdk/pro/pro.go | 11 +-- internalsdk/pro/user.go | 2 +- lib/core/service/websocket_subscriber.dart | 5 +- lib/main.dart | 4 +- 9 files changed, 55 insertions(+), 63 deletions(-) diff --git a/desktop/app/app.go b/desktop/app/app.go index 6ea041328..2c2fb1a98 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -674,7 +674,8 @@ func (app *App) ProClient() proclient.ProClient { // Client session methods func (app *App) FetchUserData() error { - go app.proClient.PaymentMethodsCache(context.Background()) + go app.proClient.UserData(context.Background()) + go app.proClient.FetchPaymentMethodsAndCache(context.Background()) return nil } diff --git a/desktop/app/pro.go b/desktop/app/pro.go index 418391892..860ffdc70 100644 --- a/desktop/app/pro.go +++ b/desktop/app/pro.go @@ -4,9 +4,7 @@ import ( "context" "encoding/json" "reflect" - "time" - "github.com/getlantern/errors" "github.com/getlantern/flashlight/v7/common" "github.com/getlantern/lantern-client/desktop/ws" "github.com/getlantern/lantern-client/internalsdk/pro" @@ -109,44 +107,44 @@ func (app *App) IsProUserFast(uc common.UserConfig) (isPro bool, statusKnown boo // It loops forever in 10 seconds interval until the user is fetched or // created, as it's fundamental for the UI to work. func (app *App) servePro(channel ws.UIChannel) error { - chFetch := make(chan bool) - ctx := context.Background() - go func() { - fetchOrCreate := func() error { - userID := app.settings.GetUserID() - if userID == 0 { - resp, err := app.proClient.UserCreate(ctx) - if err != nil { - return errors.New("Could not create new Pro user: %v", err) - } - app.settings.SetUserIDAndToken(resp.User.UserId, resp.User.Token) - } else { - _, err := app.proClient.UserData(ctx) - if err != nil { - return errors.New("Could not get user data for %v: %v", userID, err) - } - } - return nil - } - - retry := time.NewTimer(0) - retryOnFail := func(drainChannel bool) { - if err := fetchOrCreate(); err != nil { - if drainChannel && !retry.Stop() { - <-retry.C - } - retry.Reset(10 * time.Second) - } - } - for { - select { - case <-chFetch: - retryOnFail(true) - case <-retry.C: - retryOnFail(false) - } - } - }() + // chFetch := make(chan bool) + // ctx := context.Background() + // go func() { + // fetchOrCreate := func() error { + // userID := app.settings.GetUserID() + // if userID == 0 { + // resp, err := app.proClient.UserCreate(ctx) + // if err != nil { + // return errors.New("Could not create new Pro user: %v", err) + // } + // app.settings.SetUserIDAndToken(resp.User.UserId, resp.User.Token) + // } else { + // _, err := app.proClient.UserData(ctx) + // if err != nil { + // return errors.New("Could not get user data for %v: %v", userID, err) + // } + // } + // return nil + // } + + // retry := time.NewTimer(0) + // retryOnFail := func(drainChannel bool) { + // if err := fetchOrCreate(); err != nil { + // if drainChannel && !retry.Stop() { + // <-retry.C + // } + // retry.Reset(10 * time.Second) + // } + // } + // for { + // select { + // case <-chFetch: + // retryOnFail(true) + // case <-retry.C: + // retryOnFail(false) + // } + // } + // }() service, err := channel.Register("pro", nil) if err != nil { diff --git a/desktop/auth.go b/desktop/auth.go index a603af3da..50680f1d3 100644 --- a/desktop/auth.go +++ b/desktop/auth.go @@ -70,7 +70,7 @@ func signup(email *C.char, password *C.char) *C.char { saveUserSalt(salt) setting.SetEmailAddress(C.GoString(email)) a.SetUserLoggedIn(true) - a.ProClient().PaymentMethodsCache(context.Background()) + a.ProClient().FetchPaymentMethodsAndCache(context.Background()) return C.CString("true") } diff --git a/desktop/settings/settings.go b/desktop/settings/settings.go index 0f405d425..ffb29c6e6 100644 --- a/desktop/settings/settings.go +++ b/desktop/settings/settings.go @@ -620,11 +620,6 @@ func (s *Settings) GetToken() string { return s.getString(SNUserToken) } -// GetToken returns the user token -func (s *Settings) FetchUserData() error { - return nil -} - // GetMigratedDeviceIDForUserID returns the user ID (if any) for which the current device's ID has been migrated from the old style to the new style func (s *Settings) GetMigratedDeviceIDForUserID() int64 { return s.getInt64(SNMigratedDeviceIDForUserID) diff --git a/internalsdk/pro/plans.go b/internalsdk/pro/plans.go index b83c655f9..4ebadca57 100644 --- a/internalsdk/pro/plans.go +++ b/internalsdk/pro/plans.go @@ -14,7 +14,7 @@ func (c *proClient) Plans(ctx context.Context) ([]protos.Plan, error) { log.Debugf("Returning plans from cache %s", v) return resp, nil } - resp, err := c.PaymentMethodsCache(ctx) + resp, err := c.FetchPaymentMethodsAndCache(ctx) if err != nil { return nil, err } @@ -37,7 +37,7 @@ func (c *proClient) paymentMethodsByPlatform(ctx context.Context, platform strin log.Debugf("Returning payment methods from cache %s", v) return resp, nil } - resp, err := c.PaymentMethodsCache(ctx) + resp, err := c.FetchPaymentMethodsAndCache(ctx) if err != nil { return nil, err } @@ -48,9 +48,9 @@ func (c *proClient) paymentMethodsByPlatform(ctx context.Context, platform strin return desktopProviders, nil } -// PaymentMethodsCache returns the plans and payment plans available to a user +// FetchPaymentMethodsAndCache returns the plans and payment plans available to a user // Updates cache with the fetched data -func (c *proClient) PaymentMethodsCache(ctx context.Context) (*PaymentMethodsResponse, error) { +func (c *proClient) FetchPaymentMethodsAndCache(ctx context.Context) (*PaymentMethodsResponse, error) { resp, err := c.PaymentMethodsV4(context.Background()) if err != nil { return nil, errors.New("Could not get payment methods: %v", err) diff --git a/internalsdk/pro/pro.go b/internalsdk/pro/pro.go index 64b06ae4f..cde7bab66 100644 --- a/internalsdk/pro/pro.go +++ b/internalsdk/pro/pro.go @@ -46,7 +46,7 @@ type ProClient interface { PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) - PaymentMethodsCache(ctx context.Context) (*PaymentMethodsResponse, error) + FetchPaymentMethodsAndCache(ctx context.Context) (*PaymentMethodsResponse, error) Plans(ctx context.Context) ([]protos.Plan, error) PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration, client Client) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) @@ -174,7 +174,8 @@ func (c *proClient) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsRespon } // process plans for currency - for i, plan := range resp.Plans { + for i := range resp.Plans { + plan := &resp.Plans[i] parts := strings.Split(plan.Id, "-") if len(parts) != 3 { continue @@ -188,9 +189,9 @@ func (c *proClient) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsRespon amount := decimal.NewFromInt(monthlyPrice).Div(decimal.NewFromInt(100)) yearAmount := decimal.NewFromInt(yearlyPrice).Div(decimal.NewFromInt(100)) - resp.Plans[i].OneMonthCost = ac.FormatMoneyDecimal(amount) - resp.Plans[i].TotalCost = ac.FormatMoneyDecimal(yearAmount) - resp.Plans[i].TotalCostBilledOneTime = fmt.Sprintf("%v billed one time", ac.FormatMoneyDecimal(yearAmount)) + plan.OneMonthCost = ac.FormatMoneyDecimal(amount) + plan.TotalCost = ac.FormatMoneyDecimal(yearAmount) + plan.TotalCostBilledOneTime = fmt.Sprintf("%v billed one time", ac.FormatMoneyDecimal(yearAmount)) } return &resp, nil } diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index c07f7c375..23f3be1cb 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -61,7 +61,7 @@ func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession, maxEl expBackoff.InitialInterval = 3 * time.Second expBackoff.MaxInterval = 1 * time.Minute expBackoff.MaxElapsedTime = maxElapsedTime - expBackoff.RandomizationFactor = 0.5 // Add jitter to backoff interval + expBackoff.RandomizationFactor = 0.5 err := backoff.Retry(func() error { return c.createUser(ctx, ss) }, backoff.WithContext(expBackoff, ctx)) diff --git a/lib/core/service/websocket_subscriber.dart b/lib/core/service/websocket_subscriber.dart index 2fc72ed89..904f0660d 100644 --- a/lib/core/service/websocket_subscriber.dart +++ b/lib/core/service/websocket_subscriber.dart @@ -90,9 +90,8 @@ class WebsocketSubscriber { final deviceLinkingCode = message['deviceLinkingCode']; final isLevelPro = userLevel != null && userLevel == 'pro'; final isStatusPro = userStatus != null && userStatus == 'active'; - if (isLevelPro || isStatusPro) { - sessionModel.proUserNotifier.value = true; - } + sessionModel.proUserNotifier.value = (isLevelPro || isStatusPro); + if (deviceLinkingCode != null) { sessionModel.linkingCodeNotifier.value = deviceLinkingCode; } diff --git a/lib/main.dart b/lib/main.dart index a9470117a..b9ed0cde6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,14 +2,12 @@ import 'dart:ui' as ui; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; import 'package:lantern/app.dart'; +import 'package:lantern/core/service/app_purchase.dart'; import 'package:lantern/core/utils/common.dart'; import 'package:lantern/core/utils/common_desktop.dart'; -import 'package:lantern/core/service/app_purchase.dart'; import 'package:lantern/features/replica/ui/utils.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:window_manager/window_manager.dart'; From 68d579d0006d01bb5b56a18717d4927672a31d61 Mon Sep 17 00:00:00 2001 From: Jigar-f Date: Thu, 5 Dec 2024 17:48:25 +0530 Subject: [PATCH 22/23] remove commented code. --- internalsdk/android.go | 8 -------- internalsdk/pro/user.go | 11 +---------- lib/core/service/websocket_subscriber.dart | 1 - 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/internalsdk/android.go b/internalsdk/android.go index 5d9b60a36..04c294be9 100644 --- a/internalsdk/android.go +++ b/internalsdk/android.go @@ -709,15 +709,7 @@ func geoLookup(session PanickingSession) { } func afterStart(wrappedSession Session, session PanickingSession) { - - // if session.GetUserID() == 0 { - // ctx := context.Background() - // proClient := createProClient(wrappedSession, "android") - // go proClient.RetryCreateUser(ctx, session, 10*time.Minute) - // } - bandwidthUpdates(session) - go func() { if <-geolookup.OnRefresh() { geoLookup(session) diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index 23f3be1cb..ad7be8ba3 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -10,15 +10,6 @@ import ( "github.com/getlantern/lantern-client/internalsdk/protos" ) -// // UserConfig represents the minimal configuration necessary for a client session -// type UserConfig interface { -// GetDeviceID() string -// GetUserFirstVisit() bool -// GetUserID() int64 -// GetToken() string -// Locale() string -// } - type ClientSession interface { SetExpiration(int64) error SetProUser(bool) error @@ -61,7 +52,7 @@ func (c *proClient) RetryCreateUser(ctx context.Context, ss ClientSession, maxEl expBackoff.InitialInterval = 3 * time.Second expBackoff.MaxInterval = 1 * time.Minute expBackoff.MaxElapsedTime = maxElapsedTime - expBackoff.RandomizationFactor = 0.5 + expBackoff.RandomizationFactor = 0.5 err := backoff.Retry(func() error { return c.createUser(ctx, ss) }, backoff.WithContext(expBackoff, ctx)) diff --git a/lib/core/service/websocket_subscriber.dart b/lib/core/service/websocket_subscriber.dart index 904f0660d..142f77d8b 100644 --- a/lib/core/service/websocket_subscriber.dart +++ b/lib/core/service/websocket_subscriber.dart @@ -91,7 +91,6 @@ class WebsocketSubscriber { final isLevelPro = userLevel != null && userLevel == 'pro'; final isStatusPro = userStatus != null && userStatus == 'active'; sessionModel.proUserNotifier.value = (isLevelPro || isStatusPro); - if (deviceLinkingCode != null) { sessionModel.linkingCodeNotifier.value = deviceLinkingCode; } From fb0e3260e51e54955a04a48d862738cd3601dccd Mon Sep 17 00:00:00 2001 From: atavism Date: Thu, 5 Dec 2024 08:19:12 -0800 Subject: [PATCH 23/23] clean-ups --- desktop/app/pro.go | 49 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/desktop/app/pro.go b/desktop/app/pro.go index 860ffdc70..4050df4fe 100644 --- a/desktop/app/pro.go +++ b/desktop/app/pro.go @@ -12,7 +12,7 @@ import ( ) // onProStatusChange allows registering an event handler to learn when the -// user's pro status or "yinbi enabled" status has changed. +// user's pro status changes func (app *App) onProStatusChange(cb func(isPro bool)) { app.setOnUserData(func(current *protos.User, new *protos.User) { if current == nil || isActive(current) != isActive(new) { @@ -107,53 +107,16 @@ func (app *App) IsProUserFast(uc common.UserConfig) (isPro bool, statusKnown boo // It loops forever in 10 seconds interval until the user is fetched or // created, as it's fundamental for the UI to work. func (app *App) servePro(channel ws.UIChannel) error { - // chFetch := make(chan bool) - // ctx := context.Background() - // go func() { - // fetchOrCreate := func() error { - // userID := app.settings.GetUserID() - // if userID == 0 { - // resp, err := app.proClient.UserCreate(ctx) - // if err != nil { - // return errors.New("Could not create new Pro user: %v", err) - // } - // app.settings.SetUserIDAndToken(resp.User.UserId, resp.User.Token) - // } else { - // _, err := app.proClient.UserData(ctx) - // if err != nil { - // return errors.New("Could not get user data for %v: %v", userID, err) - // } - // } - // return nil - // } - - // retry := time.NewTimer(0) - // retryOnFail := func(drainChannel bool) { - // if err := fetchOrCreate(); err != nil { - // if drainChannel && !retry.Stop() { - // <-retry.C - // } - // retry.Reset(10 * time.Second) - // } - // } - // for { - // select { - // case <-chFetch: - // retryOnFail(true) - // case <-retry.C: - // retryOnFail(false) - // } - // } - // }() - service, err := channel.Register("pro", nil) if err != nil { return err } app.setOnUserData(func(current *protos.User, new *protos.User) { - b, _ := json.Marshal(new) - log.Debugf("Sending updated user data to all clients: %s", string(b)) - service.Out <- new + if new != nil { + b, _ := json.Marshal(new) + log.Debugf("Sending updated user data to all clients: %s", string(b)) + service.Out <- new + } }) return err }