types

package
v1.3.33 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneK            = 1 << 10
	OneMeg          = 1 << 20
	TwoGigs         = OneGig * 2
	QuarterGig      = 256 * OneMeg
	HalfGig         = QuarterGig * 2
	OneGig          = HalfGig * 2
	MaxDomainsInMap = 1024
	TickEvery       = 10 * time.Second
	Parallelism     = 2
	RandomDelay     = 60 * time.Second
	APIRetryMax     = 3
	//
	ReadTimeout  = 30 * time.Second
	WriteTimeout = 30 * time.Second
	IdleTimeout  = 60 * time.Second
	//
	GetDomainsRetry = 60 * time.Second
	// process control.
	CrawlerExtra     = 10 * time.Second
	KillSleep        = 3 * time.Second
	CrawlFilterRetry = 60 * time.Second
	HeadCheckTimeout = 10 * time.Second
	// process limits.
	CrawlerMaxRunTime = 600 * time.Second
)

Variables

View Source
var (
	FreyaKey = os.Getenv("FREYA")                      // nolint:gochecknoglobals
	APIBase  = "https://api.domainsproject.org/api/vo" // nolint:gochecknoglobals
)

Functions

This section is empty.

Types

type APIClientInterface

type APIClientInterface interface {
	GetUA(uaURL string) (string, error)
	GetDomains() ([]string, error)
	FilterDomains(incoming []string) (outgoing []string, err error)
	Fatal(args ...interface{})
	Debugf(format string, args ...interface{})
	GetLogger() *log.Logger
}

type APIServerInterface

type APIServerInterface interface {
	UploadDomains(w http.ResponseWriter, r *http.Request)
	UA(w http.ResponseWriter, r *http.Request)
	Pop() string
	GetUA() string
}

type DomainsResponse

type DomainsResponse struct {
	Domains []string `json:"domains"`
}

type JSONResponse

type JSONResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

type WorkerCalculator

type WorkerCalculator interface {
	CalculateMaxWorkers() (int64, error)
}

Jump to

Keyboard shortcuts

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