hashprefix

package
v0.107.53 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package hashprefix used for safe browsing and parent control.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

func New

func New(conf *Config) (c *Checker)

New returns Checker.

func (*Checker) Check

func (c *Checker) Check(host string) (ok bool, err error)

Check returns true if request for the host should be blocked.

type Config

type Config struct {
	// Upstream is the upstream DNS server.
	Upstream upstream.Upstream

	// ServiceName is the name of the service.
	ServiceName string

	// TXTSuffix is the TXT suffix for DNS request.
	TXTSuffix string

	// CacheTime is the time period to store hash.
	CacheTime time.Duration

	// CacheSize is the maximum size of the cache.  If it's zero, cache size is
	// unlimited.
	CacheSize uint
}

Config is the configuration structure for safe browsing and parental control.

Jump to

Keyboard shortcuts

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