Documentation ¶
Index ¶
- Constants
- type CompatibleProvider
- func (cp *CompatibleProvider) Destroy() error
- 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) Reload() error
- 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) Destroy() error
- 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) Reload() error
- func (pp *ProxySetProvider) Type() ProviderType
- func (pp *ProxySetProvider) Update() error
- func (pp *ProxySetProvider) VehicleType() VehicleType
- 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
}
func NewCompatibleProvider ¶ added in v0.18.0
func NewCompatibleProvider(name string, proxies []C.Proxy, hc *HealthCheck) (*CompatibleProvider, error)
func (*CompatibleProvider) Destroy ¶ added in v0.18.0
func (cp *CompatibleProvider) Destroy() error
func (*CompatibleProvider) HealthCheck ¶ added in v0.18.0
func (cp *CompatibleProvider) HealthCheck()
func (*CompatibleProvider) Initial ¶ added in v0.18.0
func (cp *CompatibleProvider) Initial() error
func (*CompatibleProvider) MarshalJSON ¶ added in v0.18.0
func (cp *CompatibleProvider) MarshalJSON() ([]byte, error)
func (*CompatibleProvider) Name ¶ added in v0.18.0
func (cp *CompatibleProvider) Name() string
func (*CompatibleProvider) Proxies ¶ added in v0.18.0
func (cp *CompatibleProvider) Proxies() []C.Proxy
func (*CompatibleProvider) Reload ¶ added in v0.18.0
func (cp *CompatibleProvider) Reload() error
func (*CompatibleProvider) Type ¶ added in v0.18.0
func (cp *CompatibleProvider) Type() ProviderType
func (*CompatibleProvider) Update ¶ added in v0.18.0
func (cp *CompatibleProvider) Update() error
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 ¶
func NewHealthCheck(proxies []C.Proxy, url string, interval uint) *HealthCheck
type HealthCheckOption ¶
type Provider ¶
type Provider interface { Name() string VehicleType() VehicleType Type() ProviderType Initial() error Reload() error Destroy() 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 ¶
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
}
func NewProxySetProvider ¶
func NewProxySetProvider(name string, interval time.Duration, vehicle Vehicle, hc *HealthCheck) *ProxySetProvider
func (*ProxySetProvider) Destroy ¶
func (pp *ProxySetProvider) Destroy() error
func (*ProxySetProvider) HealthCheck ¶
func (pp *ProxySetProvider) HealthCheck()
func (*ProxySetProvider) Initial ¶
func (pp *ProxySetProvider) Initial() error
func (*ProxySetProvider) MarshalJSON ¶
func (pp *ProxySetProvider) MarshalJSON() ([]byte, error)
func (*ProxySetProvider) Name ¶
func (pp *ProxySetProvider) Name() string
func (*ProxySetProvider) Proxies ¶
func (pp *ProxySetProvider) Proxies() []C.Proxy
func (*ProxySetProvider) Reload ¶
func (pp *ProxySetProvider) Reload() error
func (*ProxySetProvider) Type ¶
func (pp *ProxySetProvider) Type() ProviderType
func (*ProxySetProvider) Update ¶
func (pp *ProxySetProvider) Update() error
func (*ProxySetProvider) VehicleType ¶
func (pp *ProxySetProvider) VehicleType() VehicleType
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.