adguard

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdguardProvider

func NewAdguardProvider(domainFilter endpoint.DomainFilter, config *Configuration) (provider.Provider, error)

NewAdguardProvider initializes a new provider

Types

type Client

type Client interface {
	GetFilteringRules(ctx context.Context) ([]string, error)
	SetFilteringRules(ctx context.Context, rules []string) error
}

Client interface for interacting with Adguard See the OpenAPI spec: https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/openapi/openapi.yaml

type Configuration

type Configuration struct {
	URL      string `env:"ADGUARD_URL,notEmpty"`
	User     string `env:"ADGUARD_USER"`
	Password string `env:"ADGUARD_PASSWORD"`
	DryRun   bool   `env:"DRY_RUN" envDefault:"false"`
}

Configuration holds configuration from environmental variables

type Provider

type Provider struct {
	provider.BaseProvider
	// contains filtered or unexported fields
}

Provider type for interfacing with Adguard

func (*Provider) ApplyChanges

func (p *Provider) ApplyChanges(ctx context.Context, changes *plan.Changes) error

ApplyChanges syncs the desired state with Adguard

func (*Provider) Records

func (p *Provider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)

Records reads all endpoints from Adguard

Jump to

Keyboard shortcuts

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