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 { // Cloner is used to clone messages taken from filtering-result cache. Cloner *dnsmsg.Cloner // Refreshable is the configuration of the refreshable filter-list within // the safe-search filter. Refreshable *internal.RefreshableConfig // Resolver is used to resolve the IP addresses of replacement hosts. Resolver agdnet.Resolver // ErrColl is used to report errors of replacement-host resolving. ErrColl errcoll.Interface // 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 // CacheSize is the number of items in the result cache. CacheSize int }
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 ¶
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 *dns.Msg, ri *agd.RequestInfo, ) (r internal.Result, err error)
FilterRequest implements the internal.RequestFilter interface for *Filter. It modifies the response if host matches f.
func (*Filter) ID ¶
func (f *Filter) ID() (id agd.FilterListID)
ID implements the internal.RequestFilter interface for *Filter.
Click to show internal directories.
Click to hide internal directories.