pihole

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPiholeServer = errors.New("no pihole server found in the environment or flags")

ErrNoPiholeServer is returned when there is no Pihole server configured in the environment.

Functions

This section is empty.

Types

type PiholeConfig

type PiholeConfig struct {
	// The root URL of the Pi-hole server.
	Server string
	// An optional password if the server is protected.
	Password string
	// Disable verification of TLS certificates.
	TLSInsecureSkipVerify bool
	// A filter to apply when looking up and applying records.
	DomainFilter endpoint.DomainFilter
	// Do nothing and log what would have changed to stdout.
	DryRun bool
}

PiholeConfig is used for configuring a PiholeProvider.

type PiholeProvider

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

PiholeProvider is an implementation of Provider for Pi-hole Local DNS.

func NewPiholeProvider

func NewPiholeProvider(cfg PiholeConfig) (*PiholeProvider, error)

NewPiholeProvider initializes a new Pi-hole Local DNS based Provider.

func (*PiholeProvider) ApplyChanges

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

ApplyChanges implements Provider, syncing desired state with the Pi-hole server Local DNS.

func (*PiholeProvider) Records

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

Records implements Provider, populating a slice of endpoints from Pi-Hole local DNS.

Jump to

Keyboard shortcuts

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