sing-box/adapter/fakeip.go

29 lines
594 B
Go
Raw Normal View History

2023-03-25 04:03:23 +00:00
package adapter
import (
"net/netip"
"github.com/sagernet/sing-dns"
)
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
FakeIPLoad(address netip.Addr) (string, bool)
FakeIPReset() error
}
2023-06-10 08:26:40 +00:00
type FakeIPTransport interface {
dns.Transport
Store() FakeIPStore
}