versionfile

package
v0.18.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 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

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

func LoadDatabaseVersionFile() (*DatabaseVersionFile, error)

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

func NewDBVersionFile

func NewDBVersionFile() *DatabaseVersionFile

func (DatabaseVersionFile) IsValid

func (s DatabaseVersionFile) IsValid() bool

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

func (*DatabaseVersionFile) MigrateFrom

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

func (*DatabaseVersionFile) Save

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

func (f *InstalledVersion) MaintainLegacy()

MaintainLegacy keeps the values of the legacy properties for backward compatibility

func (*InstalledVersion) MigrateLegacy

func (f *InstalledVersion) MigrateLegacy()

MigrateLegacy migrates the legacy properties into new properties

type LegacyCompositeVersionFile

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

func LoadLegacyVersionFile() (*LegacyCompositeVersionFile, error)

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

type PluginVersionFile

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

func LoadPluginVersionFile

func LoadPluginVersionFile() (*PluginVersionFile, error)

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

func NewPluginVersionFile

func NewPluginVersionFile() *PluginVersionFile

func (PluginVersionFile) IsValid

func (f PluginVersionFile) IsValid() bool

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

func (*PluginVersionFile) MigrateFrom

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

func (*PluginVersionFile) Save

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