provider

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 4 Imported by: 1

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
	Count() int
	// Touch 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
	Touch()
	HealthCheck()
	Version() uint32
	RegisterHealthCheckTask(url string, expectedStatus utils.IntRanges[uint16], filter string, interval uint)
	HealthCheckURL() string
	SetSubscriptionInfo(userInfo string)
}

ProxyProvider interface

type RuleBehavior

type RuleBehavior int

RuleBehavior defined

const (
	Domain RuleBehavior = iota
	IPCIDR
	Classical
)

Rule Behavior

func ParseBehavior added in v1.18.7

func ParseBehavior(s string) (behavior RuleBehavior, err error)

func (RuleBehavior) Byte added in v1.18.7

func (rt RuleBehavior) Byte() byte

func (RuleBehavior) String

func (rt RuleBehavior) String() string

type RuleFormat

type RuleFormat int
const (
	YamlRule RuleFormat = iota
	TextRule
	MrsRule
)

func ParseRuleFormat added in v1.18.7

func ParseRuleFormat(s string) (format RuleFormat, err error)

func (RuleFormat) String

func (rf RuleFormat) String() string

type RuleProvider

type RuleProvider interface {
	Provider
	Behavior() RuleBehavior
	Count() int
	Match(*constant.Metadata) bool
	ShouldResolveIP() bool
	ShouldFindProcess() bool
	Strategy() any
}

RuleProvider interface

type Tunnel added in v1.18.6

type Tunnel interface {
	Providers() map[string]ProxyProvider
	RuleProviders() map[string]RuleProvider
	RuleUpdateCallback() *utils.Callback[RuleProvider]
}

type Vehicle

type Vehicle interface {
	Read(ctx context.Context, oldHash utils.HashType) (buf []byte, hash utils.HashType, err error)
	Write(buf []byte) error
	Path() string
	Url() string
	Proxy() 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