resolver

package
v0.6.29 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 16 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 {
	Started  time.Time // when the request starts
	Protocol string    // the protocol that the request came in with
	Groups   []string  // the groups that belong to the original requester
	// contains filtered or unexported fields
}

additional information passed along with the request

func DefaultRequestContext

func DefaultRequestContext() *RequestContext

func (*RequestContext) Put added in v0.6.23

func (context *RequestContext) Put()

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/block status (todo: make Match not block)
	Blocked     bool
	BlockedList *config.GudgeonList // pointer to blocked list
	BlockedRule string              // name of actual rule
	// contains filtered or unexported fields
}

information relevant to the process of resolution

func DefaultResolutionContext

func DefaultResolutionContext() *ResolutionContext

func DefaultResolutionContextWithMap

func DefaultResolutionContextWithMap(resolverMap ResolverMap) *ResolutionContext

func (*ResolutionContext) Put added in v0.6.23

func (context *ResolutionContext) Put()

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
	// contains filtered or unexported fields
}

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

func (*ResolutionResult) Put added in v0.6.23

func (result *ResolutionResult) Put()

type Resolver

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

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
	Close()
	// 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)
	Close()
}

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