Documentation ¶
Index ¶
Constants ¶
const DatabaseStructVersion = 20220411
const PluginStructVersion = 20220411
Variables ¶
var (
ErrNoContent = errors.New("no content")
)
Functions ¶
func FormatTime ¶
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