mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 05:11:17 +08:00
chore: add Count for ProxyProvider
This commit is contained in:
parent
b1301b1b41
commit
595a575cde
@ -98,6 +98,10 @@ func (pp *proxySetProvider) Proxies() []C.Proxy {
|
|||||||
return pp.proxies
|
return pp.proxies
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (pp *proxySetProvider) Count() int {
|
||||||
|
return len(pp.proxies)
|
||||||
|
}
|
||||||
|
|
||||||
func (pp *proxySetProvider) Touch() {
|
func (pp *proxySetProvider) Touch() {
|
||||||
pp.healthCheck.touch()
|
pp.healthCheck.touch()
|
||||||
}
|
}
|
||||||
@ -267,6 +271,10 @@ func (cp *compatibleProvider) Proxies() []C.Proxy {
|
|||||||
return cp.proxies
|
return cp.proxies
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (cp *compatibleProvider) Count() int {
|
||||||
|
return len(cp.proxies)
|
||||||
|
}
|
||||||
|
|
||||||
func (cp *compatibleProvider) Touch() {
|
func (cp *compatibleProvider) Touch() {
|
||||||
cp.healthCheck.touch()
|
cp.healthCheck.touch()
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ type Provider interface {
|
|||||||
type ProxyProvider interface {
|
type ProxyProvider interface {
|
||||||
Provider
|
Provider
|
||||||
Proxies() []constant.Proxy
|
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.
|
// 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
|
// Commonly used in DialContext and DialPacketConn
|
||||||
Touch()
|
Touch()
|
||||||
|
Loading…
Reference in New Issue
Block a user