Skip to content

Commit 1024d45

Browse files
authored
[mobile] Export lazy connection environment variables for mobile clients (#5310)
* [client] Export lazy connection env vars Both for Android and iOS * [client] Separate comments
1 parent e5d4947 commit 1024d45

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

client/android/env_list.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
package android
22

3-
import "github.com/netbirdio/netbird/client/internal/peer"
3+
import (
4+
"github.com/netbirdio/netbird/client/internal/lazyconn"
5+
"github.com/netbirdio/netbird/client/internal/peer"
6+
)
47

58
var (
6-
// EnvKeyNBForceRelay Exported for Android java client
9+
// EnvKeyNBForceRelay Exported for Android java client to force relay connections
710
EnvKeyNBForceRelay = peer.EnvKeyNBForceRelay
11+
12+
// EnvKeyNBLazyConn Exported for Android java client to configure lazy connection
13+
EnvKeyNBLazyConn = lazyconn.EnvEnableLazyConn
14+
15+
// EnvKeyNBInactivityThreshold Exported for Android java client to configure connection inactivity threshold
16+
EnvKeyNBInactivityThreshold = lazyconn.EnvInactivityThreshold
817
)
918

1019
// EnvList wraps a Go map for export to Java

client/ios/NetBirdSDK/env_list.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
package NetBirdSDK
44

5-
import "github.com/netbirdio/netbird/client/internal/peer"
5+
import (
6+
"github.com/netbirdio/netbird/client/internal/lazyconn"
7+
"github.com/netbirdio/netbird/client/internal/peer"
8+
)
69

710
// EnvList is an exported struct to be bound by gomobile
811
type EnvList struct {
@@ -32,3 +35,13 @@ func (el *EnvList) AllItems() map[string]string {
3235
func GetEnvKeyNBForceRelay() string {
3336
return peer.EnvKeyNBForceRelay
3437
}
38+
39+
// GetEnvKeyNBLazyConn Exports the environment variable for the iOS client
40+
func GetEnvKeyNBLazyConn() string {
41+
return lazyconn.EnvEnableLazyConn
42+
}
43+
44+
// GetEnvKeyNBInactivityThreshold Exports the environment variable for the iOS client
45+
func GetEnvKeyNBInactivityThreshold() string {
46+
return lazyconn.EnvInactivityThreshold
47+
}

0 commit comments

Comments
 (0)