40 lines
1 KiB
Python
40 lines
1 KiB
Python
from collections import namedtuple
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class Options:
|
|
# TODO: move these out of Options, since they're really not.
|
|
execution: object = None
|
|
ipinfo: object = None
|
|
ips: object = None
|
|
|
|
ip_simul: int = 15 # how many IPs to connect to at once
|
|
domain_simul: int = 3 # how many domains per IP to request at once
|
|
|
|
ip_wait: float = 0.05
|
|
domain_wait: float = 0.25
|
|
|
|
impatient: bool = False # reduce retries and times for timeouts
|
|
early_stopping: bool = True # stop at the first invalid domain
|
|
dry: bool = True # don't write anything to database
|
|
progress: bool = False # periodically print progress to stderr
|
|
blocking_file_io: bool = False # halt execution until inputs arrive
|
|
|
|
|
|
@dataclass
|
|
class Entry:
|
|
from datetime import datetime
|
|
|
|
date: datetime
|
|
success: bool
|
|
server: str
|
|
kind: str
|
|
domain: str
|
|
exception: str
|
|
addrs: list # list of strings
|
|
reason: str
|
|
execution: object
|
|
|
|
|
|
Check = namedtuple("Check", ("kind", "domain", "failures"))
|