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