Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidMetadataElemType indicates that element type is not supported. // The common case is when we are expecting a file with a given name, but // we have directory instead (and vice versa). ErrInvalidMetadataElemType = errors.New("Invalid artifact type") // ErrMissingMetadataElem is returned after scanning archive and detecting // that some element is missing (there are few which are required). ErrMissingMetadataElem = errors.New("Missing artifact") // ErrUnsupportedElement is returned after detecting file or directory, // which should not belong to artifact. ErrUnsupportedElement = errors.New("Unsupported artifact") )
var ErrValidatingData = errors.New("error validating data")
ErrValidatingData is an error returned by Validate() in case of invalid data.
Functions ¶
This section is empty.
Types ¶
type ArtifactHeader ¶
ArtifactHeader is a filesystem structure containing information about all required elements of given Mender artifact.
func (ArtifactHeader) CheckHeaderStructure ¶
func (ah ArtifactHeader) CheckHeaderStructure(headerDir string) error
CheckHeaderStructure checks if headerDir directory contains all needed files and sub-directories for creating Mender artifact.
type DirEntry ¶
type DirEntry struct { // absolute path to file or directory Path string // specifies if entry is directory or file IsDir bool // some files are optional thus ew want to check if given entry is needed Required bool }
DirEntry contains information about single enttry of artifact archive.
type Files ¶
type Files struct {
FileList []string `json:"files"`
}
Files represents the list of file names that make up the payload for given update.
type HeaderInfo ¶
type HeaderInfo struct { Updates []UpdateType `json:"updates"` CompatibleDevices []string `json:"device_types_compatible"` ArtifactName string `json:"artifact_name"` }
HeaderInfo contains information of numner and type of update files archived in Mender metadata archive.
func (HeaderInfo) Validate ¶
func (hi HeaderInfo) Validate() error
Validate checks if header-info structure is correct.
type Info ¶
Info contains the information about the format and the version of artifact archive.
type Metadata ¶
type Metadata map[string]interface{}
Metadata contains artifacts metadata information. The exact metadata fields are user-defined and are not specified. The only requirement is that those must be stored in a for of JSON. The fields which must exist are update-type dependent. In case of `rootfs-update` image type, there are no additional fields required.
type TypeInfo ¶
type TypeInfo struct {
Type string `json:"type"`
}
TypeInfo provides information of type of individual updates archived in artifacts archive.
type UpdateType ¶
type UpdateType struct {
Type string `json:"type"`
}
UpdateType provides information about the type of update. At the moment we are supporting only "rootfs-image" type.
type WriteValidator ¶
WriteValidator is the interface that wraps the io.Writer interface and Validate method.