Documentation ¶
Index ¶
- Constants
- func CmdRun(req Config)
- func Connect()
- func Disconnect()
- func GetLastError() string
- func GetVpnStatus() string
- func Ping(req PingReq) error
- func Reconnect()
- func SetConfig(config *Config)
- func SetOnChangeCallback(name string, fn func())
- func SetOnChangeCallbackFilterSame(name string, fn func(vpnStatus string, lastErr string))
- func Toggle()
- type Client
- type Config
- type PingReq
Constants ¶
View Source
const ( Disconnected = "Disconnected" Connecting = "Connecting" Connected = "Connected" Reconnecting = "Reconnecting" )
Variables ¶
This section is empty.
Functions ¶
func Disconnect ¶
func Disconnect()
func GetLastError ¶
func GetLastError() string
func GetVpnStatus ¶
func GetVpnStatus() string
func SetOnChangeCallback ¶
func SetOnChangeCallback(name string, fn func())
Types ¶
type Config ¶
type Config struct { ServerIp string `json:",omitempty"` ServerTKey string `json:",omitempty"` IsRelay bool `json:",omitempty"` ExitServerClientId uint64 `json:",omitempty"` //required when IsRelay is true ExitServerTKey string `json:",omitempty"` //required when IsRelay is true ServerChk string `json:",omitempty"` // if it is "", it will use InsecureSkipVerify DisableUsePublicRouteServer bool `json:",omitempty"` }
func ParseAndVerifyConfigS ¶
Click to show internal directories.
Click to hide internal directories.