configmgr

package
v0.108.0-b.28 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package configmgr defines the AdGuard Home on-disk configuration entities and configuration manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles full and partial changes in the configuration, persisting them to disk if necessary.

func New

func New(fileName string, start time.Time) (m *Manager, err error)

New creates a new *Manager that persists changes to the file pointed to by fileName. It reads the configuration file and populates the service fields. start is the startup time of AdGuard Home.

func (*Manager) DNS

func (m *Manager) DNS() (dns agh.ServiceWithConfig[*dnssvc.Config])

DNS returns the current DNS service. It is safe for concurrent use.

func (*Manager) UpdateDNS

func (m *Manager) UpdateDNS(ctx context.Context, c *dnssvc.Config) (err error)

UpdateDNS implements the websvc.ConfigManager interface for *Manager. The fields of c must not be modified after calling UpdateDNS.

func (*Manager) UpdateWeb

func (m *Manager) UpdateWeb(ctx context.Context, c *websvc.Config) (err error)

UpdateWeb implements the websvc.ConfigManager interface for *Manager. The fields of c must not be modified after calling UpdateWeb.

func (*Manager) Web

func (m *Manager) Web() (web agh.ServiceWithConfig[*websvc.Config])

Web returns the current web service. It is safe for concurrent use.

Jump to

Keyboard shortcuts

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