feat: proxies group URLTest api
This commit is contained in:
@ -108,6 +108,11 @@ type ProxyAdapter interface {
|
||||
Unwrap(metadata *Metadata) Proxy
|
||||
}
|
||||
|
||||
type Group interface {
|
||||
URLTest(ctx context.Context, url string) (mp map[string]uint16, err error)
|
||||
GetProxies(touch bool) []Proxy
|
||||
}
|
||||
|
||||
type DelayHistory struct {
|
||||
Time time.Time `json:"time"`
|
||||
Delay uint16 `json:"delay"`
|
||||
|
@ -1,7 +1,7 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"github.com/Dreamacro/clash/constant"
|
||||
C "github.com/Dreamacro/clash/constant"
|
||||
)
|
||||
|
||||
// Vehicle Type
|
||||
@ -65,10 +65,10 @@ type Provider interface {
|
||||
// ProxyProvider interface
|
||||
type ProxyProvider interface {
|
||||
Provider
|
||||
Proxies() []constant.Proxy
|
||||
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 DialContext and DialPacketConn
|
||||
ProxiesWithTouch() []constant.Proxy
|
||||
ProxiesWithTouch() []C.Proxy
|
||||
HealthCheck()
|
||||
Version() uint
|
||||
}
|
||||
@ -100,7 +100,7 @@ func (rt RuleType) String() string {
|
||||
type RuleProvider interface {
|
||||
Provider
|
||||
Behavior() RuleType
|
||||
Match(*constant.Metadata) bool
|
||||
Match(*C.Metadata) bool
|
||||
ShouldResolveIP() bool
|
||||
AsRule(adaptor string) constant.Rule
|
||||
AsRule(adaptor string) C.Rule
|
||||
}
|
||||
|
Reference in New Issue
Block a user