Documentation ¶
Index ¶
- func CheckVersion() int
- func CheckVersionX() string
- func ClearAssetsOverride(path string)
- func SetAssetsOverride(path string, data string)
- type InterfaceInfo
- type QRScanContext
- type QRScanReport
- type StabilityAssist
- type StabilityAssistSupportSet
- type StatControler
- type StringArrayList
- type V2RayCallbacks
- type V2RayContext
- func (vc *V2RayContext) AssignConfigureFile(cf string)
- func (vc *V2RayContext) CheckConfigureFile() bool
- func (vc *V2RayContext) GetBriefDesc(pathn string) string
- func (vc *V2RayContext) GetConfigureFile() string
- func (vc *V2RayContext) ListConfigureFileDir() *StringArrayList
- func (vc *V2RayContext) ReadProp(name string) (string, error)
- func (vc *V2RayContext) ReadPropD(name string) string
- func (vc *V2RayContext) ScanQR() *QRScanContext
- func (vc *V2RayContext) SetPackageName(PackageName string)
- func (vc *V2RayContext) WriteProp(name string, cont string) error
- type V2RayContextCallbacks
- type V2RayPoint
- func (v *V2RayPoint) GetIsRunning() bool
- func (v *V2RayPoint) GetStatControler() *StatControler
- func (v *V2RayPoint) IsDebugTriggered() bool
- func (v *V2RayPoint) NetworkInterrupted()
- func (v *V2RayPoint) OptinNextGenerationTunInterface()
- func (v *V2RayPoint) RunLoop()
- func (v *V2RayPoint) SetVpnSupportSet(vs V2RayVPNServiceSupportsSet)
- func (v *V2RayPoint) StopLoop()
- func (v *V2RayPoint) UpgradeToContext()
- func (v *V2RayPoint) VpnSupportReady()
- type V2RayVPNServiceSupportsSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
func CheckVersion() int
CheckVersion int This func will return libv2ray binding version.
func CheckVersionX ¶
func CheckVersionX() string
CheckVersionX string This func will return libv2ray binding version and V2Ray version used.
func ClearAssetsOverride ¶
func ClearAssetsOverride(path string)
ClearAssetsOverride can disable an override at given @path.
ClearAssetsOverride("geoip.dat") will ask libv2ray to serve vanilla asset file.
func SetAssetsOverride ¶
SetAssetsOverride will define file path @[data] to provide the asset named @path.
SetAssetsOverride("geoip.dat","/data/data/appdir/dat/geoip-override.dat") will ask libv2ray to serve v2ray "geoip.dat" with file "/data/data/appdir/dat/geoip-override.dat" in file system
Types ¶
type InterfaceInfo ¶
type InterfaceInfo struct {
RxByte, RxPacket, TxByte, TxPacket int
}
type QRScanContext ¶
type QRScanContext struct { ScanReporter QRScanReport // contains filtered or unexported fields }
var CurrentScan *QRScanContext
func (*QRScanContext) Discard ¶
func (qs *QRScanContext) Discard()
func (*QRScanContext) Finish ¶
func (qs *QRScanContext) Finish(name string) bool
func (*QRScanContext) Init ¶
func (qs *QRScanContext) Init()
func (*QRScanContext) OnNewScanResult ¶
func (qs *QRScanContext) OnNewScanResult(data string, allowdiscard bool) string
type QRScanReport ¶
type QRScanReport interface { ReadyToFinish() StatUpdate(need, acquired int) }
type StabilityAssist ¶
type StabilityAssist struct { Engaged bool Forground bool SASS StabilityAssistSupportSet // contains filtered or unexported fields }
func GetStabilityAssist ¶
func GetStabilityAssist() *StabilityAssist
func (*StabilityAssist) ProbeNowOpi ¶
func (sa *StabilityAssist) ProbeNowOpi()
func (*StabilityAssist) Start ¶
func (sa *StabilityAssist) Start()
func (*StabilityAssist) Stop ¶
func (sa *StabilityAssist) Stop()
type StabilityAssistSupportSet ¶
type StabilityAssistSupportSet interface {
OnProbeFailed()
}
type StatControler ¶
type StatControler struct { InterfaceTarget string CollectedInterfaceInfo *InterfaceInfo }
func (*StatControler) CollectInterfaceInfo ¶
func (sc *StatControler) CollectInterfaceInfo() error
type StringArrayList ¶
type StringArrayList struct {
// contains filtered or unexported fields
}
func (*StringArrayList) GetElementById ¶
func (al *StringArrayList) GetElementById(id int) string
func (*StringArrayList) GetLen ¶
func (al *StringArrayList) GetLen() int
type V2RayCallbacks ¶
V2RayCallbacks a Callback set for V2Ray
type V2RayContext ¶
type V2RayContext struct { Callbacks V2RayContextCallbacks Status *CoreI.Status // contains filtered or unexported fields }
func NewLib2rayContext ¶
func NewLib2rayContext() *V2RayContext
func (*V2RayContext) AssignConfigureFile ¶
func (vc *V2RayContext) AssignConfigureFile(cf string)
func (*V2RayContext) CheckConfigureFile ¶
func (vc *V2RayContext) CheckConfigureFile() bool
func (*V2RayContext) GetBriefDesc ¶
func (vc *V2RayContext) GetBriefDesc(pathn string) string
func (*V2RayContext) GetConfigureFile ¶
func (vc *V2RayContext) GetConfigureFile() string
func (*V2RayContext) ListConfigureFileDir ¶
func (vc *V2RayContext) ListConfigureFileDir() *StringArrayList
func (*V2RayContext) ReadPropD ¶
func (vc *V2RayContext) ReadPropD(name string) string
func (*V2RayContext) ScanQR ¶
func (vc *V2RayContext) ScanQR() *QRScanContext
func (*V2RayContext) SetPackageName ¶
func (vc *V2RayContext) SetPackageName(PackageName string)
type V2RayContextCallbacks ¶
type V2RayContextCallbacks interface { OnRefreshNeeded() OnFileSelectTriggerd() }
type V2RayPoint ¶
type V2RayPoint struct { EnvCreater Process.EnvironmentCreater Callbacks V2RayCallbacks Context *V2RayContext VPNSupports *VPN.VPNSupport UpdownScripts *UpDownScript.UpDownScript //Legacy prop, should use Context instead PackageName string ConfigureFile string ConfigureFileContent string // contains filtered or unexported fields }
V2RayPoint V2Ray Point Server This is territory of Go, so no getter and setters!
Notice: ConfigureFile can be either the path of config file or "V2Ray_internal/ConfigureFileContent" in case you wish to provide configure file with @[ConfigureFileContent] in JSON format or "V2Ray_internal/AsPbConfigureFileContent" in protobuf format.
func (*V2RayPoint) GetIsRunning ¶
func (v *V2RayPoint) GetIsRunning() bool
func (*V2RayPoint) GetStatControler ¶
func (v *V2RayPoint) GetStatControler() *StatControler
func (*V2RayPoint) IsDebugTriggered ¶
func (v *V2RayPoint) IsDebugTriggered() bool
func (*V2RayPoint) NetworkInterrupted ¶
func (v *V2RayPoint) NetworkInterrupted()
NetworkInterrupted inform us to restart the v2ray, closing dead connections.
func (*V2RayPoint) OptinNextGenerationTunInterface ¶
func (v *V2RayPoint) OptinNextGenerationTunInterface()
func (*V2RayPoint) SetVpnSupportSet ¶
func (v *V2RayPoint) SetVpnSupportSet(vs V2RayVPNServiceSupportsSet)
Delegate Funcation
func (*V2RayPoint) UpgradeToContext ¶
func (v *V2RayPoint) UpgradeToContext()
Client can opt-in V2Ray's Next Generation Interface