meta

package
v0.0.0-...-b79a0d8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//remove leading slash because that will not be present in tar
	MetaPath = strings.TrimPrefix(fp.Join(strs.ConfDir(), "imgmeta.json"), "/")
)

Functions

func ReadRaw

func ReadRaw(upd string) ([]byte, error)

ReadRaw reads a metadata file embedded at the beginning of a .upd (tar.xz) archive, returning the raw data, which is encoded as json. See also: Read()

This metadata contains more information than available in the (current) filename format. Ensuring a file comes first in a tarball is as simple as listing it first on the tar command line; it has the side effect of causing the file to appear twice in the archive but this seems to cause no problems. I think if the two were different that the 2nd would overwrite the first, given the historical use of tar (Tape ARchive).

Types

type ImgMeta

type ImgMeta struct {
	BinVer    string
	BinTime   string
	ImportJob string
	ImgJob    string
	ImgName   string
	Stream    string
}

ImgMeta is embedded in a .upd file, and describes the image and CI job. CI env vars are the source of most of these values.

func Read

func Read(upd string) (*ImgMeta, error)

Read is like ReadRaw but returns an ImgMeta struct.

func (*ImgMeta) Disktag

func (im *ImgMeta) Disktag(plat string) string

Disktag returns disktag name for given platform.

func (*ImgMeta) String

func (im *ImgMeta) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL