provider

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 1 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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() []constant.Proxy
	// ProxiesWithTouch is used to inform the provider that the proxy is actually being used while getting the list of proxies.
	// Commonly used in DialContext and DialPacketConn
	ProxiesWithTouch() []constant.Proxy
	HealthCheck()
}

ProxyProvider interface

type RuleProvider

type RuleProvider interface {
	Provider
	Behavior() RuleType
	Match(*constant.Metadata) bool
	ShouldResolveIP() bool
	AsRule(adaptor string) constant.Rule
}

RuleProvider interface

type RuleType

type RuleType int

RuleType defined

const (
	Domain RuleType = iota
	IPCIDR
	Classical
)

Rule Type

func (RuleType) String

func (rt RuleType) String() string

type Vehicle

type Vehicle interface {
	Read() ([]byte, error)
	Path() string
	Type() VehicleType
}

type VehicleType

type VehicleType int

VehicleType defined

const (
	File VehicleType = iota
	HTTP
	Compatible
)

Vehicle Type

func (VehicleType) String

func (v VehicleType) String() string

Jump to

Keyboard shortcuts

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