Documentation ¶
Index ¶
Constants ¶
const InstalledVersionStructVersion = 20230502
const (
PluginStructVersion = 20220411
)
Variables ¶
var (
ErrNoContent = errors.New("no content")
)
Functions ¶
func EnsureVersionFilesInPluginDirectories ¶
EnsureVersionFilesInPluginDirectories attempts a backfill of the individual version.json for plugins this is required only once when upgrading from 0.20.x
Types ¶
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"` StructVersion int64 `json:"struct_version"` }
func EmptyInstalledVersion ¶
func EmptyInstalledVersion() *InstalledVersion
func (*InstalledVersion) Equal ¶
func (f *InstalledVersion) Equal(other *InstalledVersion) bool
Equal compares the `Name` and `BinaryDigest`
type PluginVersionFile ¶
type PluginVersionFile struct { Plugins map[string]*InstalledVersion `json:"plugins"` StructVersion int64 `json:"struct_version"` }
func LoadPluginVersionFile ¶
func LoadPluginVersionFile(ctx context.Context) (*PluginVersionFile, error)
LoadPluginVersionFile migrates from the old version file format if necessary and loads the plugin version data
func (*PluginVersionFile) AddLocalPlugins ¶
func (p *PluginVersionFile) AddLocalPlugins(ctx context.Context) error_helpers.ErrorAndWarnings
any plugins installed under the `local` folder are added to the plugin version file
func (*PluginVersionFile) EnsurePluginVersionFile ¶
func (p *PluginVersionFile) EnsurePluginVersionFile(installData *InstalledVersion) error
EnsurePluginVersionFile reads the version file in the plugin directory (if exists) and overwrites it if the data in the argument is different. The comparison is done using the `Name` and `BinaryDigest` properties. If the file doesn't exist, or cannot be read/parsed, EnsurePluginVersionFile fails over to overwriting the data
func (*PluginVersionFile) IsValid ¶
func (p *PluginVersionFile) IsValid() bool
IsValid checks whether the struct was correctly deserialized, by checking if the StructVersion is populated
func (*PluginVersionFile) Save ¶
func (p *PluginVersionFile) Save() error
Save writes the config file to disk