parallel

package
v0.0.0-...-dd22d64 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Overview

Package parallel allows multiple checks in paralell using dnsutil.ResolvChecker interface.

This package is a work in progress and makes no API stability promises.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Client   net.IP
	Resolved net.IP
	Name     string
}

Request encapsules dnsutil resolv queries in a struct for parallel checks.

type Response

type Response struct {
	Request  Request
	Response dnsutil.CacheResponse
	Err      error
}

Response is used for store request and response in an Check parallel to the resolv checker.

func Check

func Check(ctx context.Context, checkers []dnsutil.ResolvChecker,
	requests []Request) ([]Response, bool, error)

Check checks a set of queries in parallel. It returns an slice with the response, a boolean returning true if there is an error in at least one query and an error if there was a problem in the parallel check.

Jump to

Keyboard shortcuts

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