Documentation ¶
Index ¶
Constants ¶
const MAX_CNAME_CHAIN = 10
MAX_CNAME_CHAIN indicates the longest chain of CNAME that is acceptable to be followed a name is considered a dead-end (i.e. unfit for name resolution)
const REQ_CHAN_CAPACITY = 10
REQ_CHAN_CAPACITY is the capacity of the channel into which are submitted new requests. This is used as a back off mechanism if the submitter is much faster than the finder.
const WORKER_CHAN_CAPACITY = 10
WORKER_CHAN_CAPACITY indicates the maximum number of request unhandled by the start() goroutine can be spooled before the call to Handle() becomes blocking.
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 resolution of domain names into aliases or IP addresses.
func NewFinder ¶
func NewFinder(zcHandler func(*zonecut.Request) *errors.ErrorStack, conf *tools.TransdepConfig) *Finder
NewFinder instantiates a new Finder
zcHandler is a function that may be called to submit new requests for zone cut/delegation info discovery.
maxWorkerCount is the number of concurrent workers that will be maintained by this finder. Once this number of workers reached, the Finder will shut down those that were the least recently used (LRU).
cacheRootDir is the root directory for caching. Workers that are shut down store the result that they are distributing into a cache file, for later use.
func (*Finder) Handle ¶
func (nr *Finder) Handle(req *nameresolver.Request) *errors.ErrorStack
Handle is the method to call to submit new name resolution requests. An error might be returned if this finder is already stopping.