application

package
v0.0.0-...-efa0d0c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package application defines types for describing applications.

Index

Constants

View Source
const DeviceManagerTitle = "device manager"

Device manager application envelopes must present this title.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	// Title is the publisher-assigned application title.  Application
	// installations with the same title are considered as belonging to the
	// same application by the application management system.
	//
	// A change in the title signals a new application.
	Title string
	// Args is an array of command-line arguments to be used when executing
	// the binary.
	Args []string
	// Binary identifies the application binary.
	Binary SignedFile
	// Publisher represents the set of blessings that have been bound to
	// the principal who published this binary.
	Publisher security.Blessings
	// Env is an array that stores the environment variable values to be
	// used when executing the binary.
	Env []string
	// Packages is the set of packages to install on the local filesystem
	// before executing the binary
	Packages Packages
	// Restarts specifies how many times the device manager will attempt
	// to automatically restart an application that has crashed before
	// giving up and marking the application as NotRunning.
	Restarts int32
	// RestartTimeWindow is the time window within which an
	// application exit is considered a crash that counts against the
	// Restarts budget. If the application crashes after less than
	// RestartTimeWindow time for Restarts consecutive times, the
	// application is marked NotRunning and no more restart attempts
	// are made. If the application has run continuously for more
	// than RestartTimeWindow, subsequent crashes will again benefit
	// from up to Restarts restarts (that is, the Restarts budget is
	// reset by a successful run of at least RestartTimeWindow
	// duration).
	RestartTimeWindow time.Duration
}

Envelope is a collection of metadata that describes an application.

func (Envelope) MarshalJSON

func (env Envelope) MarshalJSON() ([]byte, error)

func (*Envelope) UnmarshalJSON

func (env *Envelope) UnmarshalJSON(input []byte) error

func (Envelope) VDLIsZero

func (x Envelope) VDLIsZero() bool

func (*Envelope) VDLRead

func (x *Envelope) VDLRead(dec vdl.Decoder) error

func (Envelope) VDLWrite

func (x Envelope) VDLWrite(enc vdl.Encoder) error

type Packages

type Packages map[string]SignedFile

Packages represents a set of packages. The map key is the local file/directory name, relative to the instance's packages directory, where the package should be installed. For archives, this name represents a directory into which the archive is to be extracted, and for regular files it represents the name for the file. The map value is the package specification.

Each object's media type determines how to install it.

For example, with key=pkg1,value=SignedFile{File:binaryrepo/configfiles} (an archive), the "configfiles" package will be installed under the "pkg1" directory. With key=pkg2,value=SignedFile{File:binaryrepo/binfile} (a binary), the "binfile" file will be installed as the "pkg2" file.

The keys must be valid file/directory names, without path separators.

Any number of packages may be specified.

func (Packages) VDLIsZero

func (x Packages) VDLIsZero() bool

func (*Packages) VDLRead

func (x *Packages) VDLRead(dec vdl.Decoder) error

func (Packages) VDLWrite

func (x Packages) VDLWrite(enc vdl.Encoder) error

type SignedFile

type SignedFile struct {
	//  File is the object name of the file.
	File string
	// Signature represents a signature on the sha256 hash of the file
	// contents by the publisher principal.
	Signature security.Signature
}

SignedFile represents a file accompanied by a signature of its contents.

func (SignedFile) VDLIsZero

func (x SignedFile) VDLIsZero() bool

func (*SignedFile) VDLRead

func (x *SignedFile) VDLRead(dec vdl.Decoder) error

func (SignedFile) VDLWrite

func (x SignedFile) VDLWrite(enc vdl.Encoder) error

Jump to

Keyboard shortcuts

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