Documentation
¶
Index ¶
- Constants
- func CompareIndexVersion(index *Index) error
- type Image
- type ImageSpec
- type Index
- type Reader
- func (r *Reader) Close() error
- func (r *Reader) Decompress(name string, destination string) error
- func (r *Reader) DecompressImageTmp(img *ImageSpec) (string, error)
- func (r *Reader) DecompressTmp(name string) (string, error)
- func (r *Reader) FileCompressedSize(name string) (int, error)
- func (r *Reader) Index() ([]byte, error)
- func (r *Reader) Ls()
- type Updater
- type Writer
Constants ¶
const ( IndexFileName = "index.json" )
const (
IndexVersion = "v1.2.0"
)
Variables ¶
This section is empty.
Functions ¶
func CompareIndexVersion ¶
CompareIndexVersion compares the loaded index version with current version.
Types ¶
type Image ¶
type Image struct { Source string `json:"source,omitempty" yaml:"source,omitempty"` Tag string `json:"tag,omitempty" yaml:"tag,omitempty"` ArchList []string `json:"archList,omitempty" yaml:"archList,omitempty"` OsList []string `json:"osList,omitempty" yaml:"osList,omitempty"` Images []ImageSpec `json:"images,omitempty" yaml:"images,omitempty"` }
func (*Image) IsSigstoreSignature ¶ added in v1.8.0
IsSigstoreSignature detects whether the image is a sigstore signature.
type ImageSpec ¶
type ImageSpec struct { Arch string `json:"arch,omitempty" yaml:"arch,omitempty"` OS string `json:"os,omitempty" yaml:"os,omitempty"` OSVersion string `json:"osVersion,omitempty" yaml:"osVersion,omitempty"` OSFeatures []string `json:"osFeatures,omitempty" yaml:"osFeatures,omitempty"` Variant string `json:"variant,omitempty" yaml:"variant,omitempty"` MediaType string `json:"mediaType,omitempty" yaml:"mime,omitempty"` Layers []digest.Digest `json:"layers,omitempty" yaml:"layers,omitempty"` Config digest.Digest `json:"config,omitempty" yaml:"config,omitempty"` Digest digest.Digest `json:"digest,omitempty" yaml:"digest,omitempty"` Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` }
func (*ImageSpec) IsAttestations ¶ added in v1.8.6
type Index ¶
type Index struct { List []*Image `json:"list,omitempty" yaml:"list,omitempty"` Version string `json:"version,omitempty" yaml:"version.omitempty"` Time time.Time `json:"time,omitempty" yaml:"omitempty"` // contains filtered or unexported fields }
Index defines the data structure stores in the end of hangar archive.
func UnmarshalIndex ¶
func (*Index) HasReference ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
NewReader constructs a new Archive Reader object. Needs to call Close() method to release resource after usage.
func (*Reader) Decompress ¶
Decompress decompresses the file/directory in archive.
func (*Reader) DecompressImageTmp ¶
func (*Reader) FileCompressedSize ¶ added in v1.8.6
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater is the updater for update hangar zip archive.
func NewUpdater ¶
NewUpdater constructs a new Updater object.
func (*Updater) UpdateIndex ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer creates a new Hangar archive (zip) file and write files into it.
func (*Writer) CopyImage ¶ added in v1.7.1
CopyImage copy image blobs data from archive reader to writer.
func (*Writer) WriteIndex ¶
WriteIndex writes the index json file into the end of the zip archive.