Documentation ¶
Index ¶
- Variables
- func ReCreateServer(addr string, resolver *Resolver) error
- func ResolveIP(host string) (net.IP, error)
- func ResolveIPv4(host string) (net.IP, error)
- func ResolveIPv6(host string) (net.IP, error)
- type Config
- type EnhancedMode
- type FallbackFilter
- type NameServer
- type Resolver
- func (r *Resolver) Exchange(m *D.Msg) (msg *D.Msg, err error)
- func (r *Resolver) IPToHost(ip net.IP) (string, bool)
- func (r *Resolver) IsFakeIP() bool
- func (r *Resolver) IsMapping() bool
- func (r *Resolver) ResolveIP(host string) (ip net.IP, err error)
- func (r *Resolver) ResolveIPv4(host string) (ip net.IP, err error)
- func (r *Resolver) ResolveIPv6(host string) (ip net.IP, err error)
- 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 ReCreateServer ¶
func ResolveIPv4 ¶
ResolveIPv4 with a host, return ipv4
Types ¶
type Config ¶
type Config struct {
Main, Fallback []NameServer
IPv6 bool
EnhancedMode EnhancedMode
FallbackFilter FallbackFilter
Pool *fakeip.Pool
}
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() ([]byte, 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 ¶
type NameServer ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) ResolveIPv4 ¶
ResolveIPv4 request with TypeA
Click to show internal directories.
Click to hide internal directories.