configmigrate

package
v0.107.48 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package configmigrate provides a way to upgrade the YAML configuration file.

Index

Constants

View Source
const LastSchemaVersion uint = 28

LastSchemaVersion is the most recent schema version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// WorkingDir is an absolute path to the working directory of AdGuardHome.
	WorkingDir string
}

Config is a the configuration for initializing a Migrator.

type Migrator

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

Migrator performs the YAML configuration file migrations.

func New

func New(cfg *Config) (m *Migrator)

New creates a new Migrator.

func (*Migrator) Migrate

func (m *Migrator) Migrate(body []byte, target uint) (newBody []byte, upgraded bool, err error)

Migrate preforms necessary upgrade operations to upgrade file to target schema version, if needed. It returns the body of the upgraded config file, whether the file was upgraded, and an error, if any. If upgraded is false, the body is the same as the input.

Jump to

Keyboard shortcuts

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