blacklist

package
v0.0.0-...-0cdd980 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blacklist

type Blacklist struct {
	Entries []*Entry
}

Blacklist defines a blacklist.

func ParseData

func ParseData(data []byte) (*Blacklist, error)

ParseData parses the blacklist from the data.

func (*Blacklist) Match

func (bl *Blacklist) Match(name string) *Entry

Match matches the name to blacklist entries and returns the match or nil.

type Entry

type Entry struct {
	Labels   Labels
	Name     string
	Address  net.IP
	ProxyCmd ProxyCmd
}

Entry implements a blacklist entry.

func (Entry) Block

func (b Entry) Block() bool

Block tests if the blacklist entry is a block entry.

func (Entry) String

func (b Entry) String() string

type Labels

type Labels []string

Labels define DNS labels.

func NewLabels

func NewLabels(name string) Labels

NewLabels creates new labels instance from the argument string.q

func (Labels) Match

func (l Labels) Match(o Labels) bool

Match tests if the argument labels match this label instance.

func (Labels) String

func (l Labels) String() string

type ProxyCmd

type ProxyCmd byte

ProxyCmd defines the actions from proxied URLs.

const (
	ProxyBlock ProxyCmd = iota
	ProxyVAST
	ProxyGooglebot
)

Proxy actions.

func (ProxyCmd) String

func (cmd ProxyCmd) String() string

Jump to

Keyboard shortcuts

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