Documentation ¶
Index ¶
- Constants
- type CompatibleProvider
- func (cp CompatibleProvider) HealthCheck()
- func (cp CompatibleProvider) Initial() error
- func (cp CompatibleProvider) MarshalJSON() ([]byte, error)
- func (cp CompatibleProvider) Name() string
- func (cp CompatibleProvider) Proxies() []C.Proxy
- func (cp CompatibleProvider) ProxiesWithTouch() []C.Proxy
- func (cp CompatibleProvider) Type() ProviderType
- func (cp CompatibleProvider) Update() error
- func (cp CompatibleProvider) VehicleType() VehicleType
- type FileVehicle
- type HTTPVehicle
- type HealthCheck
- type HealthCheckOption
- type Provider
- type ProviderType
- type ProxyProvider
- type ProxySchema
- type ProxySetProvider
- func (pp ProxySetProvider) HealthCheck()
- func (pp ProxySetProvider) Initial() error
- func (pp ProxySetProvider) MarshalJSON() ([]byte, error)
- func (pp ProxySetProvider) Name() string
- func (pp ProxySetProvider) Proxies() []C.Proxy
- func (pp ProxySetProvider) ProxiesWithTouch() []C.Proxy
- func (pp ProxySetProvider) Type() ProviderType
- func (pp ProxySetProvider) Update() error
- type Vehicle
- type VehicleType
Constants ¶
View Source
const (
ReservedName = "default"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompatibleProvider ¶ added in v0.18.0
type CompatibleProvider struct {
// contains filtered or unexported fields
}
for auto gc
func NewCompatibleProvider ¶ added in v0.18.0
func NewCompatibleProvider(name string, proxies []C.Proxy, hc *HealthCheck) (*CompatibleProvider, error)
func (CompatibleProvider) HealthCheck ¶ added in v0.18.0
func (cp CompatibleProvider) HealthCheck()
func (CompatibleProvider) MarshalJSON ¶ added in v0.18.0
func (CompatibleProvider) ProxiesWithTouch ¶ added in v1.3.0
func (CompatibleProvider) Type ¶ added in v0.18.0
func (cp CompatibleProvider) Type() ProviderType
func (CompatibleProvider) VehicleType ¶ added in v0.18.0
func (cp CompatibleProvider) VehicleType() VehicleType
type FileVehicle ¶
type FileVehicle struct {
// contains filtered or unexported fields
}
func NewFileVehicle ¶
func NewFileVehicle(path string) *FileVehicle
func (*FileVehicle) Path ¶
func (f *FileVehicle) Path() string
func (*FileVehicle) Read ¶
func (f *FileVehicle) Read() ([]byte, error)
func (*FileVehicle) Type ¶
func (f *FileVehicle) Type() VehicleType
type HTTPVehicle ¶
type HTTPVehicle struct {
// contains filtered or unexported fields
}
func NewHTTPVehicle ¶
func NewHTTPVehicle(url string, path string) *HTTPVehicle
func (*HTTPVehicle) Path ¶
func (h *HTTPVehicle) Path() string
func (*HTTPVehicle) Read ¶
func (h *HTTPVehicle) Read() ([]byte, error)
func (*HTTPVehicle) Type ¶
func (h *HTTPVehicle) Type() VehicleType
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
func NewHealthCheck ¶
type HealthCheckOption ¶
type Provider ¶
type Provider interface { Name() string VehicleType() VehicleType Type() ProviderType Initial() error Update() error }
Provider interface
type ProviderType ¶
type ProviderType int
ProviderType defined
const ( Proxy ProviderType = iota Rule )
Provider Type
func (ProviderType) String ¶
func (pt ProviderType) String() string
type ProxyProvider ¶
type ProxyProvider interface { Provider Proxies() []C.Proxy // ProxiesWithTouch is used to inform the provider that the proxy is actually being used while getting the list of proxies. // Commonly used in Dial and DialUDP ProxiesWithTouch() []C.Proxy HealthCheck() }
ProxyProvider interface
func ParseProxyProvider ¶
func ParseProxyProvider(name string, mapping map[string]interface{}) (ProxyProvider, error)
type ProxySchema ¶
type ProxySchema struct {
Proxies []map[string]interface{} `yaml:"proxies"`
}
type ProxySetProvider ¶
type ProxySetProvider struct {
// contains filtered or unexported fields
}
for auto gc
func NewProxySetProvider ¶
func NewProxySetProvider(name string, interval time.Duration, vehicle Vehicle, hc *HealthCheck) *ProxySetProvider
func (ProxySetProvider) HealthCheck ¶
func (pp ProxySetProvider) HealthCheck()
func (ProxySetProvider) MarshalJSON ¶
func (ProxySetProvider) ProxiesWithTouch ¶ added in v1.3.0
func (ProxySetProvider) Type ¶
func (pp ProxySetProvider) Type() ProviderType
type VehicleType ¶
type VehicleType int
VehicleType defined
const ( File VehicleType = iota HTTP Compatible )
Vehicle Type
func (VehicleType) String ¶
func (v VehicleType) String() string
Click to show internal directories.
Click to hide internal directories.