Documentation ¶
Overview ¶
Package safesearch contains the implementation of the safe-search filter that uses lists of DNS rewrite rules to enforce safe search.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Refreshable is the configuration of the refreshable filter-list within // the safe-search filter. Refreshable *refreshable.Config // CacheTTL is the time to live of the result cache-items. // //lint:ignore U1000 TODO(a.garipov): Currently unused. See AGDNS-398. CacheTTL time.Duration }
Config contains configuration for the safe-search filter.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter modifies the results of queries to search-engine addresses and rewrites them to the IP addresses of their safe versions.
func New ¶
func New(c *Config, cache rulelist.ResultCache) (f *Filter, err error)
New returns a new safe-search filter. c must not be nil. The initial refresh should be called explicitly if necessary.
func (*Filter) FilterRequest ¶
func (f *Filter) FilterRequest( ctx context.Context, req *internal.Request, ) (r internal.Result, err error)
FilterRequest implements the internal.RequestFilter interface for *Filter. It modifies the response if host matches f.
func (*Filter) ID ¶
ID implements the internal.RequestFilter interface for *Filter.
Click to show internal directories.
Click to hide internal directories.