Documentation
¶
Overview ¶
Package configmigrate used to migrate older configuration versions to the current one.
Index ¶
Constants ¶
View Source
const BackupDateTimeFormat = time.DateOnly + "-15-04-05"
BackupDateTimeFormat is the format for timestamps in the backup directory name.
View Source
const BackupDirNameFormat = "backup-configmigrate-v%d-to-v%d-%s.dir"
BackupDirNameFormat is the format for the backup directory name, which should be filled with the current and target schema versions, and current datetime formatted according to BackupDateTimeFormat.
View Source
const SchemaVersionKey = "schema_version"
SchemaVersionKey is the key for the schema version in the YAML configuration file.
NOTE: Don't change this value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Clock is the source of current time. Clock timeutil.Clock // Logger used to log migrator operations. Logger *slog.Logger // WorkingDir is the absolute path to the working directory of AdGuardDNS // Client. WorkingDir string // ConfigFileName is the name of the configuration file within the working // directory. ConfigFileName string }
Config is the configuration for Migrator.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator performs the YAML configuration file migrations.
type SchemaVersion ¶
type SchemaVersion uint
SchemaVersion is the type for the configuration structure revision.
const ( // VersionInitial is the first version of the configuration structure ever // existed. VersionInitial SchemaVersion = 1 // VersionLatest is the current version of the configuration structure. VersionLatest SchemaVersion = 3 )
Click to show internal directories.
Click to hide internal directories.