Skip to content

Commit b56980f

Browse files
committed
settings: relegate proxyopts enums as gomobile does not export
1 parent c0e2d08 commit b56980f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

intra/settings/proxyopts.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ type AutoModeType int32
118118

119119
const (
120120
// local mode: backend.Auto uses local proxies (ex: ipn.Exit) only.
121-
AutoModeLocal AutoModeType = iota
121+
AutoModeLocal int32 = iota
122122
// remote mode: backend.Auto uses remote proxies (ex: RPN) only.
123123
AutoModeRemote
124124
// hybrid mode: backend.Auto uses local and remote proxies.
125125
AutoModeHybrid
126126
)
127127

128128
func (m AutoModeType) String() string {
129-
switch m {
129+
switch int32(m) {
130130
case AutoModeLocal:
131131
return "local"
132132
case AutoModeRemote:
@@ -140,8 +140,8 @@ func (m AutoModeType) String() string {
140140

141141
// SetAutoMode sets the global AutoMode variable to y.
142142
// Indicates if backend.Auto proxy is in local, remote, or hybrid mode.
143-
func SetAutoMode(m AutoModeType) (prev int32) {
144-
return AutoMode.Swap(int32(m))
143+
func SetAutoMode(m int32) (prev int32) {
144+
return AutoMode.Swap(m)
145145
}
146146

147147
func AutoModeStr() string {
@@ -150,12 +150,12 @@ func AutoModeStr() string {
150150

151151
// backend.Auto must use remote proxies and never use local (ex: ipn.Exit) ones.
152152
func AutoAlwaysRemote() bool {
153-
return AutoModeType(AutoMode.Load()) == AutoModeRemote
153+
return AutoMode.Load() == AutoModeRemote
154154
}
155155

156156
// backend.Auto is effecively not active.
157157
func AutoActive() bool {
158-
return AutoModeType(AutoMode.Load()) != AutoModeLocal
158+
return AutoMode.Load() != AutoModeLocal
159159
}
160160

161161
// AutoDialsParallel is a global variable to instruct ipn.Auto proxy

0 commit comments

Comments
 (0)