safesearch

package
v0.108.0-b.30 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package safesearch implements safesearch host matching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSafeSearch

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

DefaultSafeSearch is the default safesearch struct.

func NewDefaultSafeSearch

func NewDefaultSafeSearch(
	conf filtering.SafeSearchConfig,
	cacheSize uint,
	cacheTime time.Duration,
) (ss *DefaultSafeSearch, err error)

NewDefaultSafeSearch returns new safesearch struct. CacheTime is an element TTL (in minutes).

func (*DefaultSafeSearch) CheckHost

func (ss *DefaultSafeSearch) CheckHost(
	host string,
	qtype uint16,
) (res filtering.Result, err error)

CheckHost implements the filtering.SafeSearch interface for *DefaultSafeSearch.

func (*DefaultSafeSearch) SearchHost

func (ss *DefaultSafeSearch) SearchHost(host string, qtype uint16) (res *rules.DNSRewrite)

SearchHost implements the filtering.SafeSearch interface for *DefaultSafeSearch.

type Service

type Service string

Service is a enum with service names used as search providers.

const (
	Bing       Service = "bing"
	DuckDuckGo Service = "duckduckgo"
	Google     Service = "google"
	Pixabay    Service = "pixabay"
	Yandex     Service = "yandex"
	YouTube    Service = "youtube"
)

Service enum members.

Jump to

Keyboard shortcuts

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