Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingDot If a line contains no period (and not an ipv6 address) ErrMissingDot = errors.New("missing period") // ErrTooManyCIDRAddresses If too many addresses in a CIDR block are encountered ErrTooManyCIDRAddresses = errors.New("too many addresses in CIDR block") // ErrTooManyAddresses if we exceeded our total address count ErrTooManyAddresses = errors.New("too many addresses in input list") // ErrInvalidIP if the ip address is malformed (starts/ends with number but does not parse) ErrInvalidIP = errors.New("parsing IP address failure") // ErrHostMatchesETLD if the host is a public suffix ErrHostMatchesETLD = errors.New("host provided matches a top level domain") // ErrInvalidURLHostname url parses, but hostname is invalid ErrInvalidURLHostname = errors.New("hostname in url is invalid") )
Functions ¶
Types ¶
type ParseError ¶
type ParseError struct { LineNumber int `json:"line_number"` Line string `json:"line"` Err string `json:"error"` }
ParseError contains the line number, line and parse error
func ParseList ¶
func ParseList(in io.Reader, maxAddresses int) (map[string]struct{}, []*ParseError)
ParseList parses a list of hostnames, domains, urls, ip addresses, and cidr ranges and returns a de-duplicated list of strings and any errors with line numbers returns nil if number of addresses exceeds maxAddress
Click to show internal directories.
Click to hide internal directories.