2023-03-25 12:03:23 +08:00
|
|
|
package adapter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/netip"
|
|
|
|
|
|
|
|
"github.com/sagernet/sing-dns"
|
2023-07-08 16:08:46 +08:00
|
|
|
"github.com/sagernet/sing/common/logger"
|
2023-03-25 12:03:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type FakeIPStore interface {
|
|
|
|
Service
|
|
|
|
Contains(address netip.Addr) bool
|
|
|
|
Create(domain string, strategy dns.DomainStrategy) (netip.Addr, error)
|
|
|
|
Lookup(address netip.Addr) (string, bool)
|
|
|
|
Reset() error
|
|
|
|
}
|
|
|
|
|
|
|
|
type FakeIPStorage interface {
|
|
|
|
FakeIPMetadata() *FakeIPMetadata
|
|
|
|
FakeIPSaveMetadata(metadata *FakeIPMetadata) error
|
|
|
|
FakeIPStore(address netip.Addr, domain string) error
|
2023-07-08 16:08:46 +08:00
|
|
|
FakeIPStoreAsync(address netip.Addr, domain string, logger logger.Logger)
|
2023-03-25 12:03:23 +08:00
|
|
|
FakeIPLoad(address netip.Addr) (string, bool)
|
|
|
|
FakeIPReset() error
|
|
|
|
}
|
2023-06-10 16:26:40 +08:00
|
|
|
|
|
|
|
type FakeIPTransport interface {
|
|
|
|
dns.Transport
|
|
|
|
Store() FakeIPStore
|
|
|
|
}
|