Documentation ¶
Index ¶
- Variables
- func NewDomainFilter(domains []string) *domainFilter
- func ReCreateServer(addr string, resolver *Resolver, mapper *ResolverEnhancer) error
- type Config
- type EnhancedMode
- type FallbackFilter
- type NameServer
- type Resolver
- type ResolverEnhancer
- func (h *ResolverEnhancer) FakeIPEnabled() bool
- func (h *ResolverEnhancer) FindHostByIP(ip net.IP) (string, bool)
- func (h *ResolverEnhancer) IsExistFakeIP(ip net.IP) bool
- func (h *ResolverEnhancer) IsFakeIP(ip net.IP) bool
- func (h *ResolverEnhancer) MappingEnabled() bool
- func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer)
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // EnhancedModeMapping is a mapping for EnhancedMode enum EnhancedModeMapping = map[string]EnhancedMode{ NORMAL.String(): NORMAL, FAKEIP.String(): FAKEIP, MAPPING.String(): MAPPING, } )
Functions ¶
func NewDomainFilter ¶ added in v1.2.0
func NewDomainFilter(domains []string) *domainFilter
func ReCreateServer ¶
func ReCreateServer(addr string, resolver *Resolver, mapper *ResolverEnhancer) error
Types ¶
type Config ¶
type Config struct {
Main, Fallback []NameServer
Default []NameServer
IPv6 bool
EnhancedMode EnhancedMode
FallbackFilter FallbackFilter
Pool *fakeip.Pool
Hosts *trie.DomainTrie
}
type EnhancedMode ¶
type EnhancedMode int
const ( NORMAL EnhancedMode = iota FAKEIP MAPPING )
func (EnhancedMode) MarshalJSON ¶
func (e EnhancedMode) MarshalJSON() ([]byte, error)
MarshalJSON serialize EnhancedMode with json
func (EnhancedMode) MarshalYAML ¶
func (e EnhancedMode) MarshalYAML() (interface{}, error)
MarshalYAML serialize EnhancedMode with yaml
func (EnhancedMode) String ¶
func (e EnhancedMode) String() string
func (*EnhancedMode) UnmarshalJSON ¶
func (e *EnhancedMode) UnmarshalJSON(data []byte) error
UnmarshalJSON unserialize EnhancedMode with json
func (*EnhancedMode) UnmarshalYAML ¶
func (e *EnhancedMode) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unserialize EnhancedMode with yaml
type FallbackFilter ¶ added in v0.16.0
type NameServer ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶ added in v1.2.0
func (*Resolver) ResolveIPv4 ¶ added in v0.15.0
ResolveIPv4 request with TypeA
type ResolverEnhancer ¶ added in v1.2.0
type ResolverEnhancer struct {
// contains filtered or unexported fields
}
func NewEnhancer ¶ added in v1.2.0
func NewEnhancer(cfg Config) *ResolverEnhancer
func (*ResolverEnhancer) FakeIPEnabled ¶ added in v1.2.0
func (h *ResolverEnhancer) FakeIPEnabled() bool
func (*ResolverEnhancer) FindHostByIP ¶ added in v1.2.0
func (h *ResolverEnhancer) FindHostByIP(ip net.IP) (string, bool)
func (*ResolverEnhancer) IsExistFakeIP ¶ added in v1.3.0
func (h *ResolverEnhancer) IsExistFakeIP(ip net.IP) bool
func (*ResolverEnhancer) IsFakeIP ¶ added in v1.2.0
func (h *ResolverEnhancer) IsFakeIP(ip net.IP) bool
func (*ResolverEnhancer) MappingEnabled ¶ added in v1.2.0
func (h *ResolverEnhancer) MappingEnabled() bool
func (*ResolverEnhancer) PatchFrom ¶ added in v1.2.0
func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer)
Click to show internal directories.
Click to hide internal directories.