move UpdatableProvider define in here

This commit is contained in:
wwqgtxx 2024-09-12 11:18:28 +08:00
parent 3ce66040b3
commit bbe9dc42d2

View File

@ -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()
}