images

package
v0.0.0-...-4c6cade Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2017 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactInfo

type ArtifactInfo struct {
	// Mender artifact format - the only possible value is "mender"
	//Format string `json:"format" valid:"string,equal("mender"),required"`
	Format string `json:"format" valid:"required"`

	// Mender artifact format version
	//Version uint `json:"version" valid:"uint,equal(1),required"`
	Version uint `json:"version" valid:"required"`
}

Structure with artifact version informations

type ArtifactUpdateTypeInfo

type ArtifactUpdateTypeInfo struct {
	Type string `json:"type" valid:"required"`
}

Type info structure

type Link struct {
	Uri    string    `json:"uri"`
	Expire time.Time `json:"expire,omitempty"`
}
func NewLink(uri string, expire time.Time) *Link

type SoftwareImage

type SoftwareImage struct {
	// User provided field set
	SoftwareImageMetaConstructor `bson:"meta"`

	// Field set provided with yocto image
	SoftwareImageMetaArtifactConstructor `bson:"meta_artifact"`

	// Image ID
	Id string `json:"id" bson:"_id" valid:"uuidv4,required"`

	// Last modification time, including image upload time
	Modified *time.Time `json:"modified" valid:"_"`
}

SoftwareImage YOCTO image with user application

func NewSoftwareImage

func NewSoftwareImage(
	id string,
	metaConstructor *SoftwareImageMetaConstructor,
	metaArtifactConstructor *SoftwareImageMetaArtifactConstructor) *SoftwareImage

NewSoftwareImage creates new software image object.

func (*SoftwareImage) SetModified

func (s *SoftwareImage) SetModified(time time.Time)

SetModified set last modification time for the image.

func (*SoftwareImage) Validate

func (s *SoftwareImage) Validate() error

Validate checkes structure according to valid tags.

type SoftwareImageMetaArtifactConstructor

type SoftwareImageMetaArtifactConstructor struct {
	// artifact_name from artifact file
	Name string `json:"name" bson:"name" valid:"length(1|4096),required"`

	// Compatible device types for the application
	DeviceTypesCompatible []string `json:"device_types_compatible" bson:"device_types_compatible" valid:"length(1|4096),required"`

	// Artifact version info
	Info *ArtifactInfo `json:"info" valid:"required"`

	// Flag that indicates if artifact is signed or not
	Signed bool `json:"signed" bson:"signed"`

	// List of updates
	Updates []Update `json:"updates" valid:"-"`
}

Information provided with YOCTO image

func NewSoftwareImageMetaArtifactConstructor

func NewSoftwareImageMetaArtifactConstructor() *SoftwareImageMetaArtifactConstructor

func (*SoftwareImageMetaArtifactConstructor) Validate

Validate checkes structure according to valid tags.

type SoftwareImageMetaConstructor

type SoftwareImageMetaConstructor struct {
	// Image description
	Description string `json:"description,omitempty" valid:"length(1|4096),optional"`
}

Informations provided by the user

func NewSoftwareImageMetaConstructor

func NewSoftwareImageMetaConstructor() *SoftwareImageMetaConstructor

Creates new, empty SoftwareImageMetaConstructor

func (*SoftwareImageMetaConstructor) Validate

func (s *SoftwareImageMetaConstructor) Validate() error

Validate checkes structure according to valid tags.

type Update

type Update struct {
	TypeInfo ArtifactUpdateTypeInfo `json:"type_info" valid:"required"`
	Files    []UpdateFile           `json:"files"`
	MetaData interface{}            `json:"meta_data,omitempty" valid:"optional"`
}

Update structure

type UpdateFile

type UpdateFile struct {
	// Image name
	Name string `json:"name" valid:"required"`

	// Image file checksum
	Checksum string `json:"checksum" valid:"optional"`

	// Image size
	Size int64 `json:"size" valid:"optional"`

	// Date build
	Date *time.Time `json:"date" valid:"optional"`
}

Update file structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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