resolver

package
v0.6.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestContext

type RequestContext struct {
	Protocol string   // the protocol that the request came in with
	Groups   []string // the groups that belong to the original requester
}

func DefaultRequestContext

func DefaultRequestContext() *RequestContext

type ResolutionContext

type ResolutionContext struct {
	// resolution tools / recursive issues
	ResolverMap ResolverMap // pointer to the resolvermap that started resolution, can be nil
	Visited     []string    // list of visited resolver names
	Stored      bool        // has the result been stored already
	// reporting on actual resolver/source
	ResolverUsed string // the resolver that did the work
	SourceUsed   string // actual source that did the resolution
	Cached       bool   // was the result found by querying the Cache
	// reporting on blocks
	Blocked     bool
	BlockedList *config.GudgeonList // pointer to blocked list
	BlockedRule string              // name of actual rule
}

func DefaultResolutionContext

func DefaultResolutionContext() *ResolutionContext

func DefaultResolutionContextWithMap

func DefaultResolutionContextWithMap(resolverMap ResolverMap) *ResolutionContext

type ResolutionResult

type ResolutionResult struct {
	Cached   bool
	Consumer string
	Source   string
	Resolver string
	Message  string // errors/panics/context hints

	// reporting on blocks
	Blocked bool

	// reporting on matches
	Match     rule.Match          // allowed or blocked
	MatchList *config.GudgeonList // name of blocked list
	MatchRule string              // name of actual rule
}

returned as part of resolution to get data what actually resolved the query

type Resolver

type Resolver interface {
	Answer(rCon *RequestContext, context *ResolutionContext, request *dns.Msg) (*dns.Msg, error)
}

type ResolverMap

type ResolverMap interface {
	Answer(rCon *RequestContext, resolverName string, request *dns.Msg) (*dns.Msg, *ResolutionResult, error)
	AnswerMultiResolvers(rCon *RequestContext, resolverNames []string, request *dns.Msg) (*dns.Msg, *ResolutionResult, error)

	Cache() cache.Cache
	// contains filtered or unexported methods
}

func NewResolverMap

func NewResolverMap(config *config.GudgeonConfig, configuredResolvers []*config.GudgeonResolver) ResolverMap

returns a map of resolvers with name->resolver mapping

type Source

type Source interface {
	Name() string
	Load(specification string)
	Answer(rCon *RequestContext, context *ResolutionContext, request *dns.Msg) (*dns.Msg, error)
}

func NewConfigurationSource added in v0.6.5

func NewConfigurationSource(config *config.GudgeonSource, sourceMap map[string]Source) Source

func NewSource

func NewSource(sourceSpecification string) Source

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL