processor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const VERSION = "0.3.0"

Variables

This section is empty.

Functions

func AppendIfHostMissing

func AppendIfHostMissing(slice []string, key string) []string

func ExtractTLDAndSubdomainFromString

func ExtractTLDAndSubdomainFromString(str string) (string, string)

func GetDocumentFromFile

func GetDocumentFromFile(filename string) *jsonquery.Node

Types

type Config

type Config struct {
	ProjectsPath     string `yaml:"projects_path,omitempty"`
	HttpxDomainsFile string `yaml:"httpx_domains,omitempty"`
	DpuxFile         string `yaml:"dpux,omitempty"`
	DpuxIPFile       string `yaml:"dpux_ip,omitempty"`
}

type DKIM

type DKIM struct {
	Selector string
	TXT      string
	CNAME    string
}

type DNSRecord

type DNSRecord struct {
	Host          string   `json:"Host"`
	CNAME         []string `json:"CNAMES,omitempty"`
	IPv4Addresses []string `json:"IPv4Addresses,omitempty"`
	IPv6Addresses []string `json:"IPv6Addresses,omitempty"`
	WhoisInfo     string   `json:"WhoisInfo,omitempty"`
}

func AppendDNSRecordIfMissing

func AppendDNSRecordIfMissing(slice []DNSRecord, key DNSRecord) []DNSRecord

func CreateSimpleDNSEntryFromDPUX

func CreateSimpleDNSEntryFromDPUX(record *jsonquery.Node) DNSRecord

func GetDNSRecordForHostname

func GetDNSRecordForHostname(document *jsonquery.Node, hostname string) DNSRecord

func GetDNSRecordForIPAddress

func GetDNSRecordForIPAddress(document *jsonquery.Node, ipaddress string) DNSRecord

type DPUXEntry

type DPUXEntry struct {
	Host       string   `json:"host"`
	TXT        []string `json:"txt"`
	CNAME      []string `json:"cname"`
	MX         []string `json:"mx"`
	A          []string `json:"a"`
	AAAA       []string `json:"aaaa"`
	Resolver   []string `json:"resolver"`
	SOA        []SOA    `json:"soa"`
	TTL        int      `json:"ttl"`
	StatusCode string   `json:"status_code"`
	Timestamp  string   `json:"timestamp"`
}

func GetDPUXEntry

func GetDPUXEntry(record *jsonquery.Node) DPUXEntry

type Duplicate

type Duplicate struct {
	Hostname       string   `json:"hostname,omitempty"`
	IP             string   `json:"ip,omitempty"`
	URL            string   `json:"url,omitempty"`
	BodyHash       string   `json:"bodyHash,omitempty"`
	ContentLength  int      `json:"contentLength,omitempty"`
	Lines          int      `json:"lines,omitempty"`
	Words          int      `json:"words,omitempty"`
	Status         int      `json:"status,omitempty"`
	DuplicateHosts []string `json:"duplicateHosts,omitempty"`
}

func AppendDuplicatesIfMissing

func AppendDuplicatesIfMissing(slice []Duplicate, key Duplicate) []Duplicate

type MailRecord

type MailRecord struct {
	Host        string   `json:"Host"`
	MXRecords   []string `json:"MXRecords"`
	SPFEntry    string   `json:"SPFEntry,omitempty"`
	DMARCEntry  []string `json:"DMARCEntry,omitempty"`
	DKIMEntries []DKIM   `json:"DKIMEntries,omitempty"`
	Infos       []string `json:"Infos,omitempty"`
}

type Options

type Options struct {
	SettingsFile    string
	Project         string
	File            string
	BaseFolder      string
	UniqueHostsFile string
	OnlyClean       bool
	OnlyMail        bool
	OnlyDedup       bool
	UseCleanedDNS   bool
	Silent          bool
	Version         bool
	NoColor         bool
	Verbose         bool
	Debug           bool
}

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line flags provided by a user

type Processor

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

func NewProcessor

func NewProcessor(options *Options) (*Processor, error)

func (*Processor) CleanAndFind

func (p *Processor) CleanAndFind() error

func (*Processor) CleanDNSEntries

func (p *Processor) CleanDNSEntries()

func (*Processor) CleanDomains

func (p *Processor) CleanDomains(mailRecords []MailRecord, makeCLeanedDNS bool)

func (*Processor) CleanFile

func (p *Processor) CleanFile()

func (*Processor) FindMailRecords

func (p *Processor) FindMailRecords() []MailRecord

type SOA

type SOA struct {
	Name    string `json:"name"`
	Ns      string `json:"ns"`
	Mailbox string `json:"mailbox"`
	Serial  int    `json:"serial"`
	Refresh int    `json:"refresh"`
	Retry   int    `json:"retry"`
	Expire  int    `json:"expire"`
	Minttl  int    `json:"minttl"`
}

type SimpleHTTPXEntry

type SimpleHTTPXEntry struct {
	Host          string
	BodyHash      string
	Status        int
	ContentLength int
	Lines         int
	Words         int
	Input         string
	URL           string
	Title         string
}

func AppendHTTPXEntryIfMissing

func AppendHTTPXEntryIfMissing(entries []SimpleHTTPXEntry, key SimpleHTTPXEntry) []SimpleHTTPXEntry

func CreateSimpleHostEntryFromHTTPX

func CreateSimpleHostEntryFromHTTPX(entryValues map[string]interface{}) SimpleHTTPXEntry

func GetHTTPXEntryForIPAddress

func GetHTTPXEntryForIPAddress(document *jsonquery.Node, ipaddress string) []SimpleHTTPXEntry

Jump to

Keyboard shortcuts

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