Documentation
¶
Index ¶
Constants ¶
const ( StartTag = "###### START adless\n" EndTag = "###### END adless" DescriptionComment = "# Generated by the adless CLI tool. DO NOT EDIT!\n" )
Variables ¶
var ( ErrStartTagNotFound = errors.New("start tag not found") ErrEndTagNotFound = errors.New("end tag not found") )
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a hosts file.
func (*File) RemoveDomainsBlocking ¶
RemoveDomainsBlocking removes domains located between StartTag and EndTag that were parsed from blocklists.
func (*File) Rewrite ¶
Rewrite rewrites the entire file to the content provided. os.Create method truncated file completely, then WriteString writes new content.
type LineContent ¶
type LineContent struct {
// contains filtered or unexported fields
}
func (LineContent) Format ¶
func (lc LineContent) Format() string
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is a structure that is responsible for processing blocklists, whitelists and preparing the result to save to hosts file.
func NewProcessor ¶
NewProcessor initializes Processor structure.
func (*Processor) IsSkippedDomain ¶
IsSkippedDomain checks if a domain is in the skip list. Some lists (i.e StevenBlack's) contain these as they are supposed to be used as HOST.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result contains multiple parsed blocklists.
func (Result) FormatToHostsfile ¶
type TargetResult ¶
type TargetResult struct { DomainsCount int // contains filtered or unexported fields }
TargetResult represents a parsed result of blocklist that is ready to be appended into hosts file.