Migrate to independent cache file

This commit is contained in:
世界
2023-11-28 12:00:28 +08:00
parent e3f8567690
commit bf4e556f67
16 changed files with 227 additions and 179 deletions

View File

@@ -13,15 +13,17 @@ type ClashServer interface {
PreStarter
Mode() string
ModeList() []string
StoreSelected() bool
StoreFakeIP() bool
CacheFile() ClashCacheFile
HistoryStorage() *urltest.HistoryStorage
RoutedConnection(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule) (net.Conn, Tracker)
RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext, matchedRule Rule) (N.PacketConn, Tracker)
}
type ClashCacheFile interface {
type CacheFile interface {
Service
PreStarter
StoreFakeIP() bool
LoadMode() string
StoreMode(mode string) error
LoadSelected(group string) string