dependency

package
v0.0.0-...-3d855e8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

Depfinder package contains the DNS dependency finder. Its purpose is to provide a request channel, and to build the dependency graph of a requested domain name.

Index

Constants

View Source
const REQ_CHAN_CAPACITY = 10

REQ_CHAN_CAPACITY indicates the maximum number of requests that can be queued to a dependency finder instance, before the write call is blocking.

View Source
const WORKER_CHAN_CAPACITY = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder struct {
	// contains filtered or unexported fields
}

Finder is a worker pool maintainer for the construction of dependency trees of domain names.

func NewFinder

func NewFinder(transdepConf *tools.TransdepConfig, tree *iradix.Tree) *Finder
NewFinder initializes a new dependency finder struct instance.

dependencyWorkerCount designates the maximum number of workers simultaneously live for dependency tree construction.

zoneCutWorkerCount designates the maximum number of workers simultaneously live for zone cut/delegation information retrieval. nameResolverWorkerCount designates the maximum number of workers simultaneously live for name resolution.

cacheRootDir designates the root cache directory in which the on-disk cache will be stored. The directory will be created if it does not already exist.

rootHints is the name of the file from which the root hints should be loaded.

func (*Finder) Handle

func (df *Finder) Handle(req *dependency.Request) *errors.ErrorStack

Handle is the function called to submit new requests. Caller may call req.Result() after calling Handle(req) to get the result of that Handle call. This method returns an error if the Finder is stopped.

func (*Finder) Stop

func (df *Finder) Stop() bool

Stop signals that no more requests are expected. This function must be called for proper memory and cache management. Thus, it is advised to defer a call to this function as soon as a Finder is instantiated with NewFinder().

Jump to

Keyboard shortcuts

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