application

package
v0.0.0-...-e3ab1ac Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: BSD-3-Clause Imports: 9 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) FillVDLTarget

func (m *Envelope) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*Envelope) MakeVDLTarget

func (m *Envelope) MakeVDLTarget() vdl.Target

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 EnvelopeTarget

type EnvelopeTarget struct {
	Value *Envelope

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*EnvelopeTarget) FinishField

func (t *EnvelopeTarget) FinishField(_, _ vdl.Target) error

func (*EnvelopeTarget) FinishFields

func (t *EnvelopeTarget) FinishFields(_ vdl.FieldsTarget) error

func (*EnvelopeTarget) StartField

func (t *EnvelopeTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*EnvelopeTarget) StartFields

func (t *EnvelopeTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*EnvelopeTarget) ZeroField

func (t *EnvelopeTarget) ZeroField(name string) 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) FillVDLTarget

func (m *Packages) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*Packages) MakeVDLTarget

func (m *Packages) MakeVDLTarget() vdl.Target

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 PackagesTarget

type PackagesTarget struct {
	Value *Packages

	vdl.TargetBase
	vdl.MapTargetBase
	// contains filtered or unexported fields
}

func (*PackagesTarget) FinishField

func (t *PackagesTarget) FinishField(key, field vdl.Target) error

func (*PackagesTarget) FinishKeyStartField

func (t *PackagesTarget) FinishKeyStartField(key vdl.Target) (field vdl.Target, _ error)

func (*PackagesTarget) FinishMap

func (t *PackagesTarget) FinishMap(elem vdl.MapTarget) error

func (*PackagesTarget) StartKey

func (t *PackagesTarget) StartKey() (key vdl.Target, _ error)

func (*PackagesTarget) StartMap

func (t *PackagesTarget) StartMap(tt *vdl.Type, len int) (vdl.MapTarget, 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) FillVDLTarget

func (m *SignedFile) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*SignedFile) MakeVDLTarget

func (m *SignedFile) MakeVDLTarget() vdl.Target

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

type SignedFileTarget

type SignedFileTarget struct {
	Value *SignedFile

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*SignedFileTarget) FinishField

func (t *SignedFileTarget) FinishField(_, _ vdl.Target) error

func (*SignedFileTarget) FinishFields

func (t *SignedFileTarget) FinishFields(_ vdl.FieldsTarget) error

func (*SignedFileTarget) StartField

func (t *SignedFileTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*SignedFileTarget) StartFields

func (t *SignedFileTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*SignedFileTarget) ZeroField

func (t *SignedFileTarget) ZeroField(name string) error

Jump to

Keyboard shortcuts

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