github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/pkg/ociinstaller/versionfile/installed_version.go (about)

     1  package versionfile
     2  
     3  const InstalledVersionStructVersion = 20230502
     4  
     5  type InstalledVersion struct {
     6  	Name               string `json:"name"`
     7  	Version            string `json:"version"`
     8  	ImageDigest        string `json:"image_digest,omitempty"`
     9  	BinaryDigest       string `json:"binary_digest,omitempty"`
    10  	BinaryArchitecture string `json:"binary_arch,omitempty"`
    11  	InstalledFrom      string `json:"installed_from,omitempty"`
    12  	LastCheckedDate    string `json:"last_checked_date,omitempty"`
    13  	InstallDate        string `json:"install_date,omitempty"`
    14  	StructVersion      int64  `json:"struct_version"`
    15  }
    16  
    17  func EmptyInstalledVersion() *InstalledVersion {
    18  	i := new(InstalledVersion)
    19  	i.StructVersion = InstalledVersionStructVersion
    20  	return i
    21  }
    22  
    23  // Equal compares the `Name` and `BinaryDigest`
    24  func (f *InstalledVersion) Equal(other *InstalledVersion) bool {
    25  	return f.Name == other.Name && f.BinaryDigest == other.BinaryDigest
    26  }