versionfile

package
v0.15.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DatabaseStructVersion = 20220411
View Source
const PluginStructVersion = 20220411

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(localTime time.Time) string

FormatTime :: format time as RFC3339 in UTC

Types

type DatabaseVersionFile added in v0.7.0

type DatabaseVersionFile struct {
	FdwExtension  InstalledVersion `json:"fdw_extension"`
	EmbeddedDB    InstalledVersion `json:"embedded_db"`
	StructVersion int64            `json:"struct_version"`

	// legacy properties included for backwards compatibility with v0.13
	LegacyFdwExtension InstalledVersion `json:"fdwExtension"`
	LegacyEmbeddedDB   InstalledVersion `json:"embeddedDB"`
}

func LoadDatabaseVersionFile added in v0.7.0

func LoadDatabaseVersionFile() (*DatabaseVersionFile, error)

LoadDatabaseVersionFile migrates from the old version file format if necessary and loads the database version data

func NewDBVersionFile added in v0.7.0

func NewDBVersionFile() *DatabaseVersionFile

func (DatabaseVersionFile) IsValid added in v0.14.0

func (s DatabaseVersionFile) IsValid() bool

IsValid checks whether the struct was correctly deserialized, by checking if the StructVersion is populated

func (*DatabaseVersionFile) MigrateFrom added in v0.14.0

func (s *DatabaseVersionFile) MigrateFrom() migrate.Migrateable

func (*DatabaseVersionFile) Save added in v0.7.0

func (f *DatabaseVersionFile) Save() error

Save writes the config

type InstalledVersion

type InstalledVersion struct {
	Name               string `json:"name"`
	Version            string `json:"version"`
	ImageDigest        string `json:"image_digest,omitempty"`
	BinaryDigest       string `json:"binary_digest,omitempty"`
	BinaryArchitecture string `json:"binary_arch,omitempty"`
	InstalledFrom      string `json:"installed_from,omitempty"`
	LastCheckedDate    string `json:"last_checked_date,omitempty"`
	InstallDate        string `json:"install_date,omitempty"`

	// legacy properties included for backwards compatibility with v0.13
	LegacyImageDigest     string `json:"imageDigest,omitempty"`
	LegacyInstalledFrom   string `json:"installedFrom,omitempty"`
	LegacyLastCheckedDate string `json:"lastCheckedDate,omitempty"`
	LegacyInstallDate     string `json:"installDate,omitempty"`
}

func (*InstalledVersion) MaintainLegacy added in v0.14.4

func (f *InstalledVersion) MaintainLegacy()

MaintainLegacy keeps the values of the legacy properties for backward compatibility

func (*InstalledVersion) MigrateLegacy added in v0.14.0

func (f *InstalledVersion) MigrateLegacy()

MigrateLegacy migrates the legacy properties into new properties

type LegacyCompositeVersionFile added in v0.14.0

type LegacyCompositeVersionFile struct {
	Plugins      map[string]*InstalledVersion `json:"plugins"`
	FdwExtension InstalledVersion             `json:"fdwExtension"`
	EmbeddedDB   InstalledVersion             `json:"embeddedDB"`
}

LegacyCompositeVersionFile is the composite version file used before v0.7.0, which contained both db and plugin properties, now split into two different files

func LoadLegacyVersionFile added in v0.7.0

func LoadLegacyVersionFile() (*LegacyCompositeVersionFile, error)

LoadLegacyVersionFile loads the legacy version file, or returns nil if it does not exist

type PluginVersionFile added in v0.7.0

type PluginVersionFile struct {
	Plugins       map[string]*InstalledVersion `json:"plugins"`
	StructVersion int64                        `json:"struct_version"`
}

func LoadPluginVersionFile added in v0.7.0

func LoadPluginVersionFile() (*PluginVersionFile, error)

LoadPluginVersionFile migrates from the old version file format if necessary and loads the plugin version data

func NewPluginVersionFile added in v0.7.0

func NewPluginVersionFile() *PluginVersionFile

func (PluginVersionFile) IsValid added in v0.14.0

func (f PluginVersionFile) IsValid() bool

IsValid checks whether the struct was correctly deserialized, by checking if the StructVersion is populated

func (*PluginVersionFile) MigrateFrom added in v0.14.0

func (f *PluginVersionFile) MigrateFrom() migrate.Migrateable

func (*PluginVersionFile) Save added in v0.7.0

func (f *PluginVersionFile) Save() error

Save writes the config file to disk

Jump to

Keyboard shortcuts

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