proxy

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncHasOnProxyError

func FuncHasOnProxyError() (fn js.Func[func(callback js.Func[func(details *OnProxyErrorArgDetails)]) bool])

FuncHasOnProxyError returns the function "WEBEXT.proxy.onProxyError.hasListener".

func FuncOffProxyError

func FuncOffProxyError() (fn js.Func[func(callback js.Func[func(details *OnProxyErrorArgDetails)])])

FuncOffProxyError returns the function "WEBEXT.proxy.onProxyError.removeListener".

func FuncOnProxyError

func FuncOnProxyError() (fn js.Func[func(callback js.Func[func(details *OnProxyErrorArgDetails)])])

FuncOnProxyError returns the function "WEBEXT.proxy.onProxyError.addListener".

func HasFuncHasOnProxyError

func HasFuncHasOnProxyError() bool

HasFuncHasOnProxyError returns true if the function "WEBEXT.proxy.onProxyError.hasListener" exists.

func HasFuncOffProxyError

func HasFuncOffProxyError() bool

HasFuncOffProxyError returns true if the function "WEBEXT.proxy.onProxyError.removeListener" exists.

func HasFuncOnProxyError

func HasFuncOnProxyError() bool

HasFuncOnProxyError returns true if the function "WEBEXT.proxy.onProxyError.addListener" exists.

func HasOnProxyError

func HasOnProxyError(callback js.Func[func(details *OnProxyErrorArgDetails)]) (ret bool)

HasOnProxyError calls the function "WEBEXT.proxy.onProxyError.hasListener" directly.

func OffProxyError

func OffProxyError(callback js.Func[func(details *OnProxyErrorArgDetails)]) (ret js.Void)

OffProxyError calls the function "WEBEXT.proxy.onProxyError.removeListener" directly.

func OnProxyError

func OnProxyError(callback js.Func[func(details *OnProxyErrorArgDetails)]) (ret js.Void)

OnProxyError calls the function "WEBEXT.proxy.onProxyError.addListener" directly.

func SetSettings

func SetSettings(val types.ChromeSetting) bool

SetSettings sets the value of property "WEBEXT.proxy.settings" to val.

It returns false if the property cannot be set.

func Settings

func Settings() (ret types.ChromeSetting, ok bool)

Settings returns the value of property "WEBEXT.proxy.settings".

The returned bool will be false if there is no such property.

func TryHasOnProxyError

func TryHasOnProxyError(callback js.Func[func(details *OnProxyErrorArgDetails)]) (ret bool, exception js.Any, ok bool)

TryHasOnProxyError calls the function "WEBEXT.proxy.onProxyError.hasListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryOffProxyError

func TryOffProxyError(callback js.Func[func(details *OnProxyErrorArgDetails)]) (ret js.Void, exception js.Any, ok bool)

TryOffProxyError calls the function "WEBEXT.proxy.onProxyError.removeListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryOnProxyError

func TryOnProxyError(callback js.Func[func(details *OnProxyErrorArgDetails)]) (ret js.Void, exception js.Any, ok bool)

TryOnProxyError calls the function "WEBEXT.proxy.onProxyError.addListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

Types

type Mode

type Mode uint32
const (
	Mode_DIRECT Mode
	Mode_AUTO_DETECT
	Mode_PAC_SCRIPT
	Mode_FIXED_SERVERS
	Mode_SYSTEM
)

func (Mode) FromRef

func (Mode) FromRef(str js.Ref) Mode

func (Mode) String

func (x Mode) String() (string, bool)

type OnProxyErrorArgDetails

type OnProxyErrorArgDetails struct {
	// Details is "OnProxyErrorArgDetails.details"
	//
	// Required
	Details js.String
	// Error is "OnProxyErrorArgDetails.error"
	//
	// Required
	Error js.String
	// Fatal is "OnProxyErrorArgDetails.fatal"
	//
	// Required
	Fatal bool

	FFI_USE bool
}

func (*OnProxyErrorArgDetails) FreeMembers

func (p *OnProxyErrorArgDetails) FreeMembers(recursive bool)

FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.

func (OnProxyErrorArgDetails) FromRef

FromRef calls UpdateFrom and returns a OnProxyErrorArgDetails with all fields set.

func (OnProxyErrorArgDetails) New

func (p OnProxyErrorArgDetails) New() js.Ref

New creates a new OnProxyErrorArgDetails in the application heap.

func (*OnProxyErrorArgDetails) Update

func (p *OnProxyErrorArgDetails) Update(ref js.Ref)

Update writes all fields of the p to the heap object referenced by ref.

func (*OnProxyErrorArgDetails) UpdateFrom

func (p *OnProxyErrorArgDetails) UpdateFrom(ref js.Ref)

UpdateFrom copies value of all fields of the heap object to p.

type OnProxyErrorEventCallback

type OnProxyErrorEventCallback[T any] struct {
	Fn  func(arg T, this js.Ref, details *OnProxyErrorArgDetails) js.Ref
	Arg T
}

func (*OnProxyErrorEventCallback[T]) DispatchCallback

func (cb *OnProxyErrorEventCallback[T]) DispatchCallback(
	targetPC uintptr, ctx *js.CallbackContext,
)

func (*OnProxyErrorEventCallback[T]) Register

func (cb *OnProxyErrorEventCallback[T]) Register() js.Func[func(details *OnProxyErrorArgDetails)]

type OnProxyErrorEventCallbackFunc

type OnProxyErrorEventCallbackFunc func(this js.Ref, details *OnProxyErrorArgDetails) js.Ref

func (OnProxyErrorEventCallbackFunc) DispatchCallback

func (fn OnProxyErrorEventCallbackFunc) DispatchCallback(
	targetPC uintptr, ctx *js.CallbackContext,
)

func (OnProxyErrorEventCallbackFunc) Register

func (fn OnProxyErrorEventCallbackFunc) Register() js.Func[func(details *OnProxyErrorArgDetails)]

type PacScript

type PacScript struct {
	// Data is "PacScript.data"
	//
	// Optional
	Data js.String
	// Mandatory is "PacScript.mandatory"
	//
	// Optional
	//
	// NOTE: FFI_USE_Mandatory MUST be set to true to make this field effective.
	Mandatory bool
	// Url is "PacScript.url"
	//
	// Optional
	Url js.String

	FFI_USE_Mandatory bool // for Mandatory.

	FFI_USE bool
}

func (*PacScript) FreeMembers

func (p *PacScript) FreeMembers(recursive bool)

FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.

func (PacScript) FromRef

func (p PacScript) FromRef(ref js.Ref) PacScript

FromRef calls UpdateFrom and returns a PacScript with all fields set.

func (PacScript) New

func (p PacScript) New() js.Ref

New creates a new PacScript in the application heap.

func (*PacScript) Update

func (p *PacScript) Update(ref js.Ref)

Update writes all fields of the p to the heap object referenced by ref.

func (*PacScript) UpdateFrom

func (p *PacScript) UpdateFrom(ref js.Ref)

UpdateFrom copies value of all fields of the heap object to p.

type ProxyConfig

type ProxyConfig struct {
	// Mode is "ProxyConfig.mode"
	//
	// Required
	Mode Mode
	// PacScript is "ProxyConfig.pacScript"
	//
	// Optional
	//
	// NOTE: PacScript.FFI_USE MUST be set to true to get PacScript used.
	PacScript PacScript
	// Rules is "ProxyConfig.rules"
	//
	// Optional
	//
	// NOTE: Rules.FFI_USE MUST be set to true to get Rules used.
	Rules ProxyRules

	FFI_USE bool
}

func (*ProxyConfig) FreeMembers

func (p *ProxyConfig) FreeMembers(recursive bool)

FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.

func (ProxyConfig) FromRef

func (p ProxyConfig) FromRef(ref js.Ref) ProxyConfig

FromRef calls UpdateFrom and returns a ProxyConfig with all fields set.

func (ProxyConfig) New

func (p ProxyConfig) New() js.Ref

New creates a new ProxyConfig in the application heap.

func (*ProxyConfig) Update

func (p *ProxyConfig) Update(ref js.Ref)

Update writes all fields of the p to the heap object referenced by ref.

func (*ProxyConfig) UpdateFrom

func (p *ProxyConfig) UpdateFrom(ref js.Ref)

UpdateFrom copies value of all fields of the heap object to p.

type ProxyRules

type ProxyRules struct {
	// BypassList is "ProxyRules.bypassList"
	//
	// Optional
	BypassList js.Array[js.String]
	// FallbackProxy is "ProxyRules.fallbackProxy"
	//
	// Optional
	//
	// NOTE: FallbackProxy.FFI_USE MUST be set to true to get FallbackProxy used.
	FallbackProxy ProxyServer
	// ProxyForFtp is "ProxyRules.proxyForFtp"
	//
	// Optional
	//
	// NOTE: ProxyForFtp.FFI_USE MUST be set to true to get ProxyForFtp used.
	ProxyForFtp ProxyServer
	// ProxyForHttp is "ProxyRules.proxyForHttp"
	//
	// Optional
	//
	// NOTE: ProxyForHttp.FFI_USE MUST be set to true to get ProxyForHttp used.
	ProxyForHttp ProxyServer
	// ProxyForHttps is "ProxyRules.proxyForHttps"
	//
	// Optional
	//
	// NOTE: ProxyForHttps.FFI_USE MUST be set to true to get ProxyForHttps used.
	ProxyForHttps ProxyServer
	// SingleProxy is "ProxyRules.singleProxy"
	//
	// Optional
	//
	// NOTE: SingleProxy.FFI_USE MUST be set to true to get SingleProxy used.
	SingleProxy ProxyServer

	FFI_USE bool
}

func (*ProxyRules) FreeMembers

func (p *ProxyRules) FreeMembers(recursive bool)

FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.

func (ProxyRules) FromRef

func (p ProxyRules) FromRef(ref js.Ref) ProxyRules

FromRef calls UpdateFrom and returns a ProxyRules with all fields set.

func (ProxyRules) New

func (p ProxyRules) New() js.Ref

New creates a new ProxyRules in the application heap.

func (*ProxyRules) Update

func (p *ProxyRules) Update(ref js.Ref)

Update writes all fields of the p to the heap object referenced by ref.

func (*ProxyRules) UpdateFrom

func (p *ProxyRules) UpdateFrom(ref js.Ref)

UpdateFrom copies value of all fields of the heap object to p.

type ProxyServer

type ProxyServer struct {
	// Host is "ProxyServer.host"
	//
	// Required
	Host js.String
	// Port is "ProxyServer.port"
	//
	// Optional
	//
	// NOTE: FFI_USE_Port MUST be set to true to make this field effective.
	Port int64
	// Scheme is "ProxyServer.scheme"
	//
	// Optional
	Scheme Scheme

	FFI_USE_Port bool // for Port.

	FFI_USE bool
}

func (*ProxyServer) FreeMembers

func (p *ProxyServer) FreeMembers(recursive bool)

FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.

func (ProxyServer) FromRef

func (p ProxyServer) FromRef(ref js.Ref) ProxyServer

FromRef calls UpdateFrom and returns a ProxyServer with all fields set.

func (ProxyServer) New

func (p ProxyServer) New() js.Ref

New creates a new ProxyServer in the application heap.

func (*ProxyServer) Update

func (p *ProxyServer) Update(ref js.Ref)

Update writes all fields of the p to the heap object referenced by ref.

func (*ProxyServer) UpdateFrom

func (p *ProxyServer) UpdateFrom(ref js.Ref)

UpdateFrom copies value of all fields of the heap object to p.

type Scheme

type Scheme uint32
const (
	Scheme_HTTP Scheme
	Scheme_HTTPS
	Scheme_QUIC
	Scheme_SOCKS4
	Scheme_SOCKS5
)

func (Scheme) FromRef

func (Scheme) FromRef(str js.Ref) Scheme

func (Scheme) String

func (x Scheme) String() (string, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL