serviceblock

package
v0.0.0-...-b6e3791 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package serviceblock contains an implementation of a filter that blocks services using rule lists. The blocking is based on the parental-control settings in the profile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

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

Filter is a service-blocking filter that uses rule lists that it gets from an index.

func New

func New(refr *internal.Refreshable, errColl errcoll.Interface) (f *Filter)

New returns a fully initialized service blocker.

func (*Filter) Refresh

func (f *Filter) Refresh(
	ctx context.Context,
	cacheSize int,
	useCache bool,
	acceptStale bool,
) (err error)

Refresh loads new service data from the index URL.

func (*Filter) RuleLists

func (f *Filter) RuleLists(
	ctx context.Context,
	ids []agd.BlockedServiceID,
) (rls []*rulelist.Immutable)

RuleLists returns the rule-list filters for the given blocked service IDs. The order of the elements in rls is undefined.

Jump to

Keyboard shortcuts

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