Documentation ¶
Index ¶
- Variables
- func HostnameQuestionFilter(qType uint16) func(args ...rules.Param) (QuestionPredicate, error)
- func ParseInAddrArpa(inAddrArpa string) net.IP
- func RRHeader(ttl time.Duration, q Question) mdns.RR_Header
- type Cache
- type CacheHandler
- type CacheOption
- type ConditionalResolver
- type Handler
- type HandlerFunc
- type IPResolver
- type IPResolverFunc
- type IncrementalIPResolver
- type Options
- type Question
- type QuestionPredicate
- type QuestionPredicateFunc
- type RandomIPResolver
- type Record
- type ResourceRecord
- type ResourceRecordCache
- type RuleHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WithTTL = func(ttl time.Duration) CacheOption { return func(cfg *cacheConfig) { if ttl > 0 { cfg.ttl = ttl } } } WithInitialSize = func(initialSize int) CacheOption { return func(cfg *cacheConfig) { if initialSize >= minimumInitialSize { cfg.initialSize = initialSize } } } )
View Source
var ErrNoAnswerForQuestion = errors.New("cannot answer given question")
Functions ¶
func HostnameQuestionFilter ¶ added in v0.7.0
func HostnameQuestionFilter(qType uint16) func(args ...rules.Param) (QuestionPredicate, error)
func ParseInAddrArpa ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(opts ...CacheOption) *Cache
type CacheHandler ¶ added in v0.7.0
type CacheHandler struct { Cache ResourceRecordCache TTL time.Duration Fallback Handler }
func (*CacheHandler) AnswerDNSQuestion ¶ added in v0.7.0
func (h *CacheHandler) AnswerDNSQuestion(q Question) (rr ResourceRecord, err error)
type CacheOption ¶
type CacheOption func(cfg *cacheConfig)
type ConditionalResolver ¶ added in v0.7.0
type ConditionalResolver struct { IPResolver Predicates []QuestionPredicate }
func (ConditionalResolver) Matches ¶ added in v0.7.0
func (c ConditionalResolver) Matches(q Question) bool
type Handler ¶ added in v0.7.0
type Handler interface {
AnswerDNSQuestion(q Question) (ResourceRecord, error)
}
func FallbackHandler ¶ added in v0.7.0
func FallbackHandler(handler Handler, resolver IPResolver, ttl time.Duration) Handler
type HandlerFunc ¶ added in v0.7.0
type HandlerFunc func(q Question) (ResourceRecord, error)
func (HandlerFunc) AnswerDNSQuestion ¶ added in v0.7.0
func (f HandlerFunc) AnswerDNSQuestion(q Question) (ResourceRecord, error)
type IPResolver ¶
func IncrementalResolverForArgs ¶ added in v0.7.0
func IncrementalResolverForArgs(args []rules.Param) (IPResolver, error)
func RandomIPResolverForArgs ¶ added in v0.7.0
func RandomIPResolverForArgs(args []rules.Param) (IPResolver, error)
func ResolverForRule ¶ added in v0.7.0
func ResolverForRule(rule *rules.SingleResponsePipeline) (IPResolver, error)
func StaticIPResolverForArgs ¶ added in v0.7.0
func StaticIPResolverForArgs(args []rules.Param) (IPResolver, error)
type IPResolverFunc ¶
type IncrementalIPResolver ¶ added in v0.7.0
type IncrementalIPResolver struct { Offset uint32 CIDR *net.IPNet // contains filtered or unexported fields }
func NewIncrementalIPResolver ¶ added in v0.7.0
func NewIncrementalIPResolver(cidr *net.IPNet) *IncrementalIPResolver
type Options ¶ added in v0.7.0
type Options struct { Rules []string Cache ResourceRecordCache Default IPResolver TTL time.Duration }
func OptionsFromLifecycle ¶ added in v0.7.0
func OptionsFromLifecycle(startupSpec *endpoint.StartupSpec) (*Options, error)
type QuestionPredicate ¶ added in v0.7.0
func QuestionPredicatesForRoutingRule ¶ added in v0.7.0
func QuestionPredicatesForRoutingRule(rule *rules.SingleResponsePipeline) (predicates []QuestionPredicate, err error)
type QuestionPredicateFunc ¶ added in v0.7.0
func (QuestionPredicateFunc) Matches ¶ added in v0.7.0
func (f QuestionPredicateFunc) Matches(q Question) bool
type RandomIPResolver ¶ added in v0.7.0
type RandomIPResolver struct { Random *rand.Rand CIDR *net.IPNet // contains filtered or unexported fields }
func NewRandomIPResolver ¶ added in v0.7.0
func NewRandomIPResolver(cidr *net.IPNet) *RandomIPResolver
nolint:gosec // pseudo-random is desired for this purpose
type ResourceRecord ¶ added in v0.7.0
type ResourceRecordCache ¶ added in v0.7.0
type RuleHandler ¶ added in v0.7.0
func (RuleHandler) AnswerDNSQuestion ¶ added in v0.7.0
func (r RuleHandler) AnswerDNSQuestion(q Question) (ResourceRecord, error)
func (*RuleHandler) RegisterRule ¶ added in v0.7.0
func (r *RuleHandler) RegisterRule(rawRule string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.