blocklist

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockList

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

BlockList type Supports wildcard domains like "*.example.com" to block all subdomains.

func New

func New(cfg *config.Config) *BlockList

New returns a new BlockList.

func (*BlockList) Exists

func (b *BlockList) Exists(key string) bool

(*BlockList).Exists exists returns whether or not a key exists in the cache.

func (*BlockList) Get

func (b *BlockList) Get(key string) (bool, error)

(*BlockList).Get get returns the entry for a key or an error.

func (*BlockList) Length

func (b *BlockList) Length() int

(*BlockList).Length length returns the caches length.

func (*BlockList) Name

func (b *BlockList) Name() string

(*BlockList).Name name return middleware name.

func (*BlockList) Remove

func (b *BlockList) Remove(key string) bool

(*BlockList).Remove remove removes an entry from the cache.

func (*BlockList) ServeDNS

func (b *BlockList) ServeDNS(ctx context.Context, ch *middleware.Chain)

(*BlockList).ServeDNS serveDNS implements the Handle interface.

func (*BlockList) Set

func (b *BlockList) Set(key string) bool

(*BlockList).Set set sets a value in the BlockList.

Jump to

Keyboard shortcuts

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