mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-25 06:46:09 +03:00
move UpdatableProvider define in here
This commit is contained in:
parent
3ce66040b3
commit
bbe9dc42d2
@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
P "github.com/metacubex/mihomo/adapter/provider"
|
|
||||||
"github.com/metacubex/mihomo/constant/provider"
|
"github.com/metacubex/mihomo/constant/provider"
|
||||||
"github.com/metacubex/mihomo/log"
|
"github.com/metacubex/mihomo/log"
|
||||||
"github.com/metacubex/mihomo/tunnel"
|
"github.com/metacubex/mihomo/tunnel"
|
||||||
@ -20,6 +19,10 @@ type Provider struct {
|
|||||||
UpdatedAt int64 `json:"updatedAt"`
|
UpdatedAt int64 `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UpdatableProvider interface {
|
||||||
|
UpdatedAt() time.Time
|
||||||
|
}
|
||||||
|
|
||||||
func QueryProviders() []*Provider {
|
func QueryProviders() []*Provider {
|
||||||
r := tunnel.RuleProviders()
|
r := tunnel.RuleProviders()
|
||||||
p := tunnel.Providers()
|
p := tunnel.Providers()
|
||||||
@ -47,7 +50,7 @@ func QueryProviders() []*Provider {
|
|||||||
for _, p := range providers {
|
for _, p := range providers {
|
||||||
updatedAt := time.Time{}
|
updatedAt := time.Time{}
|
||||||
|
|
||||||
if s, ok := p.(P.UpdatableProvider); ok {
|
if s, ok := p.(UpdatableProvider); ok {
|
||||||
updatedAt = s.UpdatedAt()
|
updatedAt = s.UpdatedAt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user