provider

package
v1.18.9 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: GPL-3.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ReservedName = "default"
)

Variables

This section is empty.

Functions

func ParseProxyProvider

func ParseProxyProvider(name string, mapping map[string]any) (types.ProxyProvider, error)

Types

type CompatibleProvider

type CompatibleProvider struct {
	// contains filtered or unexported fields
}

CompatibleProvider for auto gc

func NewCompatibleProvider

func NewCompatibleProvider(name string, proxies []C.Proxy, hc *HealthCheck) (*CompatibleProvider, error)

func (*CompatibleProvider) Close added in v1.18.8

func (cp *CompatibleProvider) Close() error

func (CompatibleProvider) Count added in v1.18.9

func (cp CompatibleProvider) Count() int

func (CompatibleProvider) HealthCheck

func (cp CompatibleProvider) HealthCheck()

func (CompatibleProvider) HealthCheckURL added in v1.18.2

func (cp CompatibleProvider) HealthCheckURL() string

func (CompatibleProvider) Initial

func (cp CompatibleProvider) Initial() error

func (CompatibleProvider) MarshalJSON

func (cp CompatibleProvider) MarshalJSON() ([]byte, error)

func (CompatibleProvider) Name

func (cp CompatibleProvider) Name() string

func (CompatibleProvider) Proxies

func (cp CompatibleProvider) Proxies() []C.Proxy

func (CompatibleProvider) RegisterHealthCheckTask

func (cp CompatibleProvider) RegisterHealthCheckTask(url string, expectedStatus utils.IntRanges[uint16], filter string, interval uint)

func (CompatibleProvider) Touch

func (cp CompatibleProvider) Touch()

func (CompatibleProvider) Type

func (cp CompatibleProvider) Type() types.ProviderType

func (CompatibleProvider) Update

func (cp CompatibleProvider) Update() error

func (CompatibleProvider) VehicleType

func (cp CompatibleProvider) VehicleType() types.VehicleType

func (CompatibleProvider) Version

func (cp CompatibleProvider) Version() uint32

type HealthCheck

type HealthCheck struct {
	// contains filtered or unexported fields
}

func NewHealthCheck

func NewHealthCheck(proxies []C.Proxy, url string, timeout uint, interval uint, lazy bool, expectedStatus utils.IntRanges[uint16]) *HealthCheck

type HealthCheckOption

type HealthCheckOption struct {
	URL      string
	Interval uint
}

type OverrideProxyNameSchema added in v1.18.9

type OverrideProxyNameSchema struct {
	// matching expression for regex replacement
	Pattern *regexp2.Regexp `provider:"pattern"`
	// the new content after regex matching
	Target string `provider:"target"`
}

type OverrideSchema

type OverrideSchema struct {
	TFO              *bool   `provider:"tfo,omitempty"`
	MPTcp            *bool   `provider:"mptcp,omitempty"`
	UDP              *bool   `provider:"udp,omitempty"`
	UDPOverTCP       *bool   `provider:"udp-over-tcp,omitempty"`
	Up               *string `provider:"up,omitempty"`
	Down             *string `provider:"down,omitempty"`
	DialerProxy      *string `provider:"dialer-proxy,omitempty"`
	SkipCertVerify   *bool   `provider:"skip-cert-verify,omitempty"`
	Interface        *string `provider:"interface-name,omitempty"`
	RoutingMark      *int    `provider:"routing-mark,omitempty"`
	IPVersion        *string `provider:"ip-version,omitempty"`
	AdditionalPrefix *string `provider:"additional-prefix,omitempty"`
	AdditionalSuffix *string `provider:"additional-suffix,omitempty"`

	ProxyName []OverrideProxyNameSchema `provider:"proxy-name,omitempty"`
}

type ProxySchema

type ProxySchema struct {
	Proxies []map[string]any `yaml:"proxies"`
}

type ProxySetProvider

type ProxySetProvider struct {
	// contains filtered or unexported fields
}

ProxySetProvider for auto gc

func NewProxySetProvider

func NewProxySetProvider(name string, interval time.Duration, filter string, excludeFilter string, excludeType string, dialerProxy string, override OverrideSchema, vehicle types.Vehicle, hc *HealthCheck) (*ProxySetProvider, error)

func (*ProxySetProvider) Close added in v1.18.8

func (pp *ProxySetProvider) Close() error

func (ProxySetProvider) Count added in v1.18.9

func (pp ProxySetProvider) Count() int

func (ProxySetProvider) HealthCheck

func (pp ProxySetProvider) HealthCheck()

func (ProxySetProvider) HealthCheckURL added in v1.18.2

func (pp ProxySetProvider) HealthCheckURL() string

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) RegisterHealthCheckTask

func (pp ProxySetProvider) RegisterHealthCheckTask(url string, expectedStatus utils.IntRanges[uint16], filter string, interval uint)

func (ProxySetProvider) Touch

func (pp ProxySetProvider) Touch()

func (ProxySetProvider) Type

func (pp ProxySetProvider) Type() types.ProviderType

func (ProxySetProvider) Update

func (pp ProxySetProvider) Update() error

func (ProxySetProvider) Version

func (pp ProxySetProvider) Version() uint32

type SubscriptionInfo

type SubscriptionInfo struct {
	Upload   int64
	Download int64
	Total    int64
	Expire   int64
}

func NewSubscriptionInfo

func NewSubscriptionInfo(userinfo string) (si *SubscriptionInfo)

Jump to

Keyboard shortcuts

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