device

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: 14 Imported by: 0

Documentation

Overview

Package device defines interfaces for managing devices and their applications.

Index

Constants

This section is empty.

Variables

View Source
var ApplicationDesc rpc.InterfaceDesc = descApplication

ApplicationDesc describes the Application interface.

View Source
var ClaimableDesc rpc.InterfaceDesc = descClaimable

ClaimableDesc describes the Claimable interface.

View Source
var DeviceDesc rpc.InterfaceDesc = descDevice

DeviceDesc describes the Device interface.

InstallationStateAll holds all labels for InstallationState.

InstanceStateAll holds all labels for InstanceState.

Functions

func VDLReadBlessClientMessage

func VDLReadBlessClientMessage(dec vdl.Decoder, x *BlessClientMessage) error

func VDLReadBlessServerMessage

func VDLReadBlessServerMessage(dec vdl.Decoder, x *BlessServerMessage) error

func VDLReadStatus

func VDLReadStatus(dec vdl.Decoder, x *Status) error

Types

type ApplicationClientMethods

type ApplicationClientMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectClientMethods
	// Install installs the application identified by the first argument and
	// returns an object name suffix that identifies the new installation.
	//
	// The name argument should be an object name for an application
	// envelope.  The service it identifies must implement
	// repository.Application, and is expected to return either the
	// requested version (if the object name encodes a specific version), or
	// otherwise the latest available version, as appropriate.  This object
	// name will be used by default by the Update method, as a source for
	// updated application envelopes (can be overriden by setting
	// AppOriginConfigKey in the config).
	//
	// The config argument specifies config settings that will take
	// precedence over those present in the application envelope.
	//
	// The packages argument specifies packages to be installed in addition
	// to those specified in the envelope.  If a package in the envelope has
	// the same key, the package in the packages argument takes precedence.
	//
	// The returned suffix, when appended to the name used to reach the
	// receiver for Install, can be used to control the installation object.
	// The suffix will contain the title of the application as a prefix,
	// which can then be used to control all the installations of the given
	// application.
	// TODO(rjkroege): Use customized labels.
	Install(_ *context.T, name string, config Config, packages application.Packages, _ ...rpc.CallOpt) (string, error)
	// Uninstall uninstalls an application installation.
	// The installation must be in state Active.
	Uninstall(*context.T, ...rpc.CallOpt) error
	// Instantiate creates an instance of an application installation.
	// The installation must be in state Active.
	//
	// The server sends the application instance's Public Key on the stream.
	// When the client receives the Public Key it must send Blessings back
	// to the server. When the instance is created, the server returns the
	// instance name to the client.
	//
	// Client                       Server
	//  "object".Instantiate() -->
	//                         <--  InstancePublicKey
	//  AppBlessings           -->
	//                         <--  return InstanceName
	Instantiate(*context.T, ...rpc.CallOpt) (ApplicationInstantiateClientCall, error)
	// Delete deletes an instance.  Once deleted, the instance cannot be
	// revived.
	// The instance must be in state NotRunning.
	//
	// If called against a Device, causes the Device to shut itself down.
	Delete(*context.T, ...rpc.CallOpt) error
	// Run begins execution of an application instance.
	// The instance must be in state NotRunning.
	Run(*context.T, ...rpc.CallOpt) error
	// Kill attempts a clean shutdown an of application instance.
	// The instance must be in state Running.
	//
	// If the deadline is non-zero and the instance in question is still
	// running after the given deadline, shutdown of the instance is
	// enforced.
	//
	// If called against a Device, causes the Device to stop itself (which
	// may or may not result in a restart depending on the device manager
	// setup).
	Kill(_ *context.T, deadline time.Duration, _ ...rpc.CallOpt) error
	// Update updates an application installation's version to a new version
	// created from the envelope at the object name provided during Install.
	// If the new application envelope contains a different application
	// title, the update does not occur, and an error is returned.  The
	// installation must be in state Active.
	//
	// Update updates an application instance's version to the current
	// installation version.  The instance must be in state NotRunning.
	Update(*context.T, ...rpc.CallOpt) error
	// UpdateTo updates the application installation(s) to the application
	// specified by the object name argument.  If the new application
	// envelope contains a different application title, the update does not
	// occur, and an error is returned.
	// The installation must be in state Active.
	UpdateTo(_ *context.T, name string, _ ...rpc.CallOpt) error
	// Revert reverts an application installation's version to the previous
	// version of its current version.  The installation must be in state
	// Active.
	//
	// Revert reverts an application instance's version to the previous
	// version of its current version.  The instance must be in state
	// NotRunning.
	Revert(*context.T, ...rpc.CallOpt) error
	// Debug returns debug information about the application installation or
	// instance.  This is generally highly implementation-specific, and
	// presented in an unstructured form.  No guarantees are given about the
	// stability of the format, and parsing it programmatically is
	// specifically discouraged.
	Debug(*context.T, ...rpc.CallOpt) (string, error)
	// Status returns structured information about the application
	// installation or instance.
	Status(*context.T, ...rpc.CallOpt) (Status, error)
}

ApplicationClientMethods is the client interface containing Application methods.

Application can be used to manage applications on a device. This interface will be invoked using an object name that identifies the application and its installations and instances where applicable.

An application is defined by a title. An application can have multiple installations on a device. The installations are grouped under the same application, but are otherwise independent of each other. Each installation can have zero or more instances (which can be running or not). The instances are independent of each other, and do not share state (like local storage). Interaction among instances should occur via Vanadium RPC, facilitated by the local mounttable.

The device manager supports versioning of applications. Each installation maintains a tree of versions, where a version is defined by a specific envelope. The tree structure comes from 'previous version' references: each version (except the initial installation version) maintains a reference to the version that preceded it. The installation maintains a current version reference that is used for new instances. Each update operation on the installation creates a new version, sets the previous reference of the new version to the current version, and then updates the current version to refer to the new version. Each revert operation on the installation sets the current version to the previous version of the current version. Each instance maintains a current version reference that is used to run the instance. The initial version of the instance is set to the current version of the installation at the time of instantiation. Each update operation on the instance updates the instance's current version to the current version of the installation. Each revert operation on the instance updates the instance's current version to the previous version of the instance's version.

The Application interface methods can be divided based on their intended receiver:

1) Method receiver is an application:

  • Install()

2) Method receiver is an application installation:

  • Instantiate()
  • Uninstall()

3) Method receiver is an application instance:

  • Run()
  • Kill()
  • Delete()

4) Method receiver is an application installation or instance:

  • Update()
  • Revert()

The following methods complement one another:

  • Install() and Uninstall()
  • Instantiate() and Delete()
  • Run() and Kill()
  • Update() and Revert()

Examples:

Install Google Maps on the device.

device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/0"

Create and start an instance of the previously installed maps application installation.

device/apps/google maps/0.Instantiate() --> { "0" }
device/apps/google maps/0/0.Run()

Create and start a second instance of the previously installed maps application installation.

device/apps/google maps/0.Instantiate() --> { "1" }
device/apps/google maps/0/1.Run()

Kill and delete the first instance previously started.

device/apps/google maps/0/0.Kill()
device/apps/google maps/0/0.Delete()

Install a second Google Maps installation.

device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/1"

Update the second maps installation to the latest version available.

device/apps/google maps/1.Update()

Update the first maps installation to a specific version.

device/apps/google maps/0.UpdateTo("/google.com/appstore/beta/maps")

Finally, an application installation instance can be in one of three abstract states: 1) "does not exist/deleted", 2) "running", or 3) "not-running". The interface methods transition between these abstract states using the following state machine:

apply(Instantiate(), "does not exist") = "not-running"
apply(Run(), "not-running") = "running"
apply(Kill(), "running") = "not-running"
apply(Delete(), "not-running") = "deleted"

type ApplicationClientStub

type ApplicationClientStub interface {
	ApplicationClientMethods
	rpc.UniversalServiceMethods
}

ApplicationClientStub adds universal methods to ApplicationClientMethods.

func ApplicationClient

func ApplicationClient(name string) ApplicationClientStub

ApplicationClient returns a client stub for Application.

type ApplicationInstantiateClientCall

type ApplicationInstantiateClientCall interface {
	ApplicationInstantiateClientStream
	// Finish performs the equivalent of SendStream().Close, then blocks until
	// the server is done, and returns the positional return values for the call.
	//
	// Finish returns immediately if the call has been canceled; depending on the
	// timing the output could either be an error signaling cancelation, or the
	// valid positional return values from the server.
	//
	// Calling Finish is mandatory for releasing stream resources, unless the call
	// has been canceled or any of the other methods return an error.  Finish should
	// be called at most once.
	Finish() (string, error)
}

ApplicationInstantiateClientCall represents the call returned from Application.Instantiate.

type ApplicationInstantiateClientStream

type ApplicationInstantiateClientStream interface {
	// RecvStream returns the receiver side of the Application.Instantiate client stream.
	RecvStream() interface {
		// Advance stages an item so that it may be retrieved via Value.  Returns
		// true iff there is an item to retrieve.  Advance must be called before
		// Value is called.  May block if an item is not available.
		Advance() bool
		// Value returns the item that was staged by Advance.  May panic if Advance
		// returned false or was not called.  Never blocks.
		Value() BlessServerMessage
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
	// SendStream returns the send side of the Application.Instantiate client stream.
	SendStream() interface {
		// Send places the item onto the output stream.  Returns errors
		// encountered while sending, or if Send is called after Close or
		// the stream has been canceled.  Blocks if there is no buffer
		// space; will unblock when buffer space is available or after
		// the stream has been canceled.
		Send(item BlessClientMessage) error
		// Close indicates to the server that no more items will be sent;
		// server Recv calls will receive io.EOF after all sent items.
		// This is an optional call - e.g. a client might call Close if it
		// needs to continue receiving items from the server after it's
		// done sending.  Returns errors encountered while closing, or if
		// Close is called after the stream has been canceled.  Like Send,
		// blocks if there is no buffer space available.
		Close() error
	}
}

ApplicationInstantiateClientStream is the client stream for Application.Instantiate.

type ApplicationInstantiateServerCall

type ApplicationInstantiateServerCall interface {
	rpc.ServerCall
	ApplicationInstantiateServerStream
}

ApplicationInstantiateServerCall represents the context passed to Application.Instantiate.

type ApplicationInstantiateServerCallStub

type ApplicationInstantiateServerCallStub struct {
	rpc.StreamServerCall
	// contains filtered or unexported fields
}

ApplicationInstantiateServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements ApplicationInstantiateServerCall.

func (*ApplicationInstantiateServerCallStub) Init

Init initializes ApplicationInstantiateServerCallStub from rpc.StreamServerCall.

func (*ApplicationInstantiateServerCallStub) RecvStream

func (s *ApplicationInstantiateServerCallStub) RecvStream() interface {
	Advance() bool
	Value() BlessClientMessage
	Err() error
}

RecvStream returns the receiver side of the Application.Instantiate server stream.

func (*ApplicationInstantiateServerCallStub) SendStream

func (s *ApplicationInstantiateServerCallStub) SendStream() interface {
	Send(item BlessServerMessage) error
}

SendStream returns the send side of the Application.Instantiate server stream.

type ApplicationInstantiateServerStream

type ApplicationInstantiateServerStream interface {
	// RecvStream returns the receiver side of the Application.Instantiate server stream.
	RecvStream() interface {
		// Advance stages an item so that it may be retrieved via Value.  Returns
		// true iff there is an item to retrieve.  Advance must be called before
		// Value is called.  May block if an item is not available.
		Advance() bool
		// Value returns the item that was staged by Advance.  May panic if Advance
		// returned false or was not called.  Never blocks.
		Value() BlessClientMessage
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
	// SendStream returns the send side of the Application.Instantiate server stream.
	SendStream() interface {
		// Send places the item onto the output stream.  Returns errors encountered
		// while sending.  Blocks if there is no buffer space; will unblock when
		// buffer space is available.
		Send(item BlessServerMessage) error
	}
}

ApplicationInstantiateServerStream is the server stream for Application.Instantiate.

type ApplicationServerMethods

type ApplicationServerMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectServerMethods
	// Install installs the application identified by the first argument and
	// returns an object name suffix that identifies the new installation.
	//
	// The name argument should be an object name for an application
	// envelope.  The service it identifies must implement
	// repository.Application, and is expected to return either the
	// requested version (if the object name encodes a specific version), or
	// otherwise the latest available version, as appropriate.  This object
	// name will be used by default by the Update method, as a source for
	// updated application envelopes (can be overriden by setting
	// AppOriginConfigKey in the config).
	//
	// The config argument specifies config settings that will take
	// precedence over those present in the application envelope.
	//
	// The packages argument specifies packages to be installed in addition
	// to those specified in the envelope.  If a package in the envelope has
	// the same key, the package in the packages argument takes precedence.
	//
	// The returned suffix, when appended to the name used to reach the
	// receiver for Install, can be used to control the installation object.
	// The suffix will contain the title of the application as a prefix,
	// which can then be used to control all the installations of the given
	// application.
	// TODO(rjkroege): Use customized labels.
	Install(_ *context.T, _ rpc.ServerCall, name string, config Config, packages application.Packages) (string, error)
	// Uninstall uninstalls an application installation.
	// The installation must be in state Active.
	Uninstall(*context.T, rpc.ServerCall) error
	// Instantiate creates an instance of an application installation.
	// The installation must be in state Active.
	//
	// The server sends the application instance's Public Key on the stream.
	// When the client receives the Public Key it must send Blessings back
	// to the server. When the instance is created, the server returns the
	// instance name to the client.
	//
	// Client                       Server
	//  "object".Instantiate() -->
	//                         <--  InstancePublicKey
	//  AppBlessings           -->
	//                         <--  return InstanceName
	Instantiate(*context.T, ApplicationInstantiateServerCall) (string, error)
	// Delete deletes an instance.  Once deleted, the instance cannot be
	// revived.
	// The instance must be in state NotRunning.
	//
	// If called against a Device, causes the Device to shut itself down.
	Delete(*context.T, rpc.ServerCall) error
	// Run begins execution of an application instance.
	// The instance must be in state NotRunning.
	Run(*context.T, rpc.ServerCall) error
	// Kill attempts a clean shutdown an of application instance.
	// The instance must be in state Running.
	//
	// If the deadline is non-zero and the instance in question is still
	// running after the given deadline, shutdown of the instance is
	// enforced.
	//
	// If called against a Device, causes the Device to stop itself (which
	// may or may not result in a restart depending on the device manager
	// setup).
	Kill(_ *context.T, _ rpc.ServerCall, deadline time.Duration) error
	// Update updates an application installation's version to a new version
	// created from the envelope at the object name provided during Install.
	// If the new application envelope contains a different application
	// title, the update does not occur, and an error is returned.  The
	// installation must be in state Active.
	//
	// Update updates an application instance's version to the current
	// installation version.  The instance must be in state NotRunning.
	Update(*context.T, rpc.ServerCall) error
	// UpdateTo updates the application installation(s) to the application
	// specified by the object name argument.  If the new application
	// envelope contains a different application title, the update does not
	// occur, and an error is returned.
	// The installation must be in state Active.
	UpdateTo(_ *context.T, _ rpc.ServerCall, name string) error
	// Revert reverts an application installation's version to the previous
	// version of its current version.  The installation must be in state
	// Active.
	//
	// Revert reverts an application instance's version to the previous
	// version of its current version.  The instance must be in state
	// NotRunning.
	Revert(*context.T, rpc.ServerCall) error
	// Debug returns debug information about the application installation or
	// instance.  This is generally highly implementation-specific, and
	// presented in an unstructured form.  No guarantees are given about the
	// stability of the format, and parsing it programmatically is
	// specifically discouraged.
	Debug(*context.T, rpc.ServerCall) (string, error)
	// Status returns structured information about the application
	// installation or instance.
	Status(*context.T, rpc.ServerCall) (Status, error)
}

ApplicationServerMethods is the interface a server writer implements for Application.

Application can be used to manage applications on a device. This interface will be invoked using an object name that identifies the application and its installations and instances where applicable.

An application is defined by a title. An application can have multiple installations on a device. The installations are grouped under the same application, but are otherwise independent of each other. Each installation can have zero or more instances (which can be running or not). The instances are independent of each other, and do not share state (like local storage). Interaction among instances should occur via Vanadium RPC, facilitated by the local mounttable.

The device manager supports versioning of applications. Each installation maintains a tree of versions, where a version is defined by a specific envelope. The tree structure comes from 'previous version' references: each version (except the initial installation version) maintains a reference to the version that preceded it. The installation maintains a current version reference that is used for new instances. Each update operation on the installation creates a new version, sets the previous reference of the new version to the current version, and then updates the current version to refer to the new version. Each revert operation on the installation sets the current version to the previous version of the current version. Each instance maintains a current version reference that is used to run the instance. The initial version of the instance is set to the current version of the installation at the time of instantiation. Each update operation on the instance updates the instance's current version to the current version of the installation. Each revert operation on the instance updates the instance's current version to the previous version of the instance's version.

The Application interface methods can be divided based on their intended receiver:

1) Method receiver is an application:

  • Install()

2) Method receiver is an application installation:

  • Instantiate()
  • Uninstall()

3) Method receiver is an application instance:

  • Run()
  • Kill()
  • Delete()

4) Method receiver is an application installation or instance:

  • Update()
  • Revert()

The following methods complement one another:

  • Install() and Uninstall()
  • Instantiate() and Delete()
  • Run() and Kill()
  • Update() and Revert()

Examples:

Install Google Maps on the device.

device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/0"

Create and start an instance of the previously installed maps application installation.

device/apps/google maps/0.Instantiate() --> { "0" }
device/apps/google maps/0/0.Run()

Create and start a second instance of the previously installed maps application installation.

device/apps/google maps/0.Instantiate() --> { "1" }
device/apps/google maps/0/1.Run()

Kill and delete the first instance previously started.

device/apps/google maps/0/0.Kill()
device/apps/google maps/0/0.Delete()

Install a second Google Maps installation.

device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/1"

Update the second maps installation to the latest version available.

device/apps/google maps/1.Update()

Update the first maps installation to a specific version.

device/apps/google maps/0.UpdateTo("/google.com/appstore/beta/maps")

Finally, an application installation instance can be in one of three abstract states: 1) "does not exist/deleted", 2) "running", or 3) "not-running". The interface methods transition between these abstract states using the following state machine:

apply(Instantiate(), "does not exist") = "not-running"
apply(Run(), "not-running") = "running"
apply(Kill(), "running") = "not-running"
apply(Delete(), "not-running") = "deleted"

type ApplicationServerStub

type ApplicationServerStub interface {
	ApplicationServerStubMethods
	// Describe the Application interfaces.
	Describe__() []rpc.InterfaceDesc
}

ApplicationServerStub adds universal methods to ApplicationServerStubMethods.

func ApplicationServer

func ApplicationServer(impl ApplicationServerMethods) ApplicationServerStub

ApplicationServer returns a server stub for Application. It converts an implementation of ApplicationServerMethods into an object that may be used by rpc.Server.

type ApplicationServerStubMethods

type ApplicationServerStubMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectServerStubMethods
	// Install installs the application identified by the first argument and
	// returns an object name suffix that identifies the new installation.
	//
	// The name argument should be an object name for an application
	// envelope.  The service it identifies must implement
	// repository.Application, and is expected to return either the
	// requested version (if the object name encodes a specific version), or
	// otherwise the latest available version, as appropriate.  This object
	// name will be used by default by the Update method, as a source for
	// updated application envelopes (can be overriden by setting
	// AppOriginConfigKey in the config).
	//
	// The config argument specifies config settings that will take
	// precedence over those present in the application envelope.
	//
	// The packages argument specifies packages to be installed in addition
	// to those specified in the envelope.  If a package in the envelope has
	// the same key, the package in the packages argument takes precedence.
	//
	// The returned suffix, when appended to the name used to reach the
	// receiver for Install, can be used to control the installation object.
	// The suffix will contain the title of the application as a prefix,
	// which can then be used to control all the installations of the given
	// application.
	// TODO(rjkroege): Use customized labels.
	Install(_ *context.T, _ rpc.ServerCall, name string, config Config, packages application.Packages) (string, error)
	// Uninstall uninstalls an application installation.
	// The installation must be in state Active.
	Uninstall(*context.T, rpc.ServerCall) error
	// Instantiate creates an instance of an application installation.
	// The installation must be in state Active.
	//
	// The server sends the application instance's Public Key on the stream.
	// When the client receives the Public Key it must send Blessings back
	// to the server. When the instance is created, the server returns the
	// instance name to the client.
	//
	// Client                       Server
	//  "object".Instantiate() -->
	//                         <--  InstancePublicKey
	//  AppBlessings           -->
	//                         <--  return InstanceName
	Instantiate(*context.T, *ApplicationInstantiateServerCallStub) (string, error)
	// Delete deletes an instance.  Once deleted, the instance cannot be
	// revived.
	// The instance must be in state NotRunning.
	//
	// If called against a Device, causes the Device to shut itself down.
	Delete(*context.T, rpc.ServerCall) error
	// Run begins execution of an application instance.
	// The instance must be in state NotRunning.
	Run(*context.T, rpc.ServerCall) error
	// Kill attempts a clean shutdown an of application instance.
	// The instance must be in state Running.
	//
	// If the deadline is non-zero and the instance in question is still
	// running after the given deadline, shutdown of the instance is
	// enforced.
	//
	// If called against a Device, causes the Device to stop itself (which
	// may or may not result in a restart depending on the device manager
	// setup).
	Kill(_ *context.T, _ rpc.ServerCall, deadline time.Duration) error
	// Update updates an application installation's version to a new version
	// created from the envelope at the object name provided during Install.
	// If the new application envelope contains a different application
	// title, the update does not occur, and an error is returned.  The
	// installation must be in state Active.
	//
	// Update updates an application instance's version to the current
	// installation version.  The instance must be in state NotRunning.
	Update(*context.T, rpc.ServerCall) error
	// UpdateTo updates the application installation(s) to the application
	// specified by the object name argument.  If the new application
	// envelope contains a different application title, the update does not
	// occur, and an error is returned.
	// The installation must be in state Active.
	UpdateTo(_ *context.T, _ rpc.ServerCall, name string) error
	// Revert reverts an application installation's version to the previous
	// version of its current version.  The installation must be in state
	// Active.
	//
	// Revert reverts an application instance's version to the previous
	// version of its current version.  The instance must be in state
	// NotRunning.
	Revert(*context.T, rpc.ServerCall) error
	// Debug returns debug information about the application installation or
	// instance.  This is generally highly implementation-specific, and
	// presented in an unstructured form.  No guarantees are given about the
	// stability of the format, and parsing it programmatically is
	// specifically discouraged.
	Debug(*context.T, rpc.ServerCall) (string, error)
	// Status returns structured information about the application
	// installation or instance.
	Status(*context.T, rpc.ServerCall) (Status, error)
}

ApplicationServerStubMethods is the server interface containing Application methods, as expected by rpc.Server. The only difference between this interface and ApplicationServerMethods is the streaming methods.

type Association

type Association struct {
	IdentityName string
	AccountName  string
}

Association is a tuple containing an association between a Vanadium identity and a system account name.

func (Association) VDLIsZero

func (x Association) VDLIsZero() bool

func (*Association) VDLRead

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

func (Association) VDLWrite

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

type BlessClientMessage

type BlessClientMessage interface {
	// Index returns the field index.
	Index() int
	// Interface returns the field value as an interface.
	Interface() interface{}
	// Name returns the field name.
	Name() string

	VDLIsZero() bool
	VDLWrite(vdl.Encoder) error
	// contains filtered or unexported methods
}

BlessClientMessage represents any single field of the BlessClientMessage union type.

BlessClientMessage is the data type that is streamed from the client to the server during a Instantiate method call. This is a union to enable backward compatible changes.

type BlessClientMessageAppBlessings

type BlessClientMessageAppBlessings struct{ Value security.Blessings }

BlessClientMessageAppBlessings represents field AppBlessings of the BlessClientMessage union type.

Blessings for the application instance.

func (BlessClientMessageAppBlessings) Index

func (BlessClientMessageAppBlessings) Interface

func (x BlessClientMessageAppBlessings) Interface() interface{}

func (BlessClientMessageAppBlessings) Name

func (BlessClientMessageAppBlessings) VDLIsZero

func (x BlessClientMessageAppBlessings) VDLIsZero() bool

func (BlessClientMessageAppBlessings) VDLWrite

type BlessServerMessage

type BlessServerMessage interface {
	// Index returns the field index.
	Index() int
	// Interface returns the field value as an interface.
	Interface() interface{}
	// Name returns the field name.
	Name() string

	VDLIsZero() bool
	VDLWrite(vdl.Encoder) error
	// contains filtered or unexported methods
}

BlessServerMessage represents any single field of the BlessServerMessage union type.

BlessServerMessage is the data type that is streamed from the server to the client during an Instantiate method call. This is a union to enable backward compatible changes.

type BlessServerMessageInstancePublicKey

type BlessServerMessageInstancePublicKey struct{ Value []byte }

BlessServerMessageInstancePublicKey represents field InstancePublicKey of the BlessServerMessage union type.

The public key of the instance being blessed. The client must return blessings for this key.

func (BlessServerMessageInstancePublicKey) Index

func (BlessServerMessageInstancePublicKey) Interface

func (x BlessServerMessageInstancePublicKey) Interface() interface{}

func (BlessServerMessageInstancePublicKey) Name

func (BlessServerMessageInstancePublicKey) VDLIsZero

func (BlessServerMessageInstancePublicKey) VDLWrite

type ClaimableClientMethods

type ClaimableClientMethods interface {
	Claim(_ *context.T, pairingToken string, _ ...rpc.CallOpt) error
}

ClaimableClientMethods is the client interface containing Claimable methods.

Claimable represents an uninitialized device with no owner (i.e., a device that has no blessings).

Claim is used to claim ownership by blessing the device's private key. Devices that have provided a pairing token to the claimer through an out-of-band communication channel (eg: display/email) would expect this pairing token to be replayed by the claimer.

Once claimed, the device will export the "Device" interface and all methods will be restricted to the claimer.

The blessings that the device is to be claimed with is provided via the ipc.Granter option in Go.

type ClaimableClientStub

type ClaimableClientStub interface {
	ClaimableClientMethods
	rpc.UniversalServiceMethods
}

ClaimableClientStub adds universal methods to ClaimableClientMethods.

func ClaimableClient

func ClaimableClient(name string) ClaimableClientStub

ClaimableClient returns a client stub for Claimable.

type ClaimableServerMethods

type ClaimableServerMethods interface {
	Claim(_ *context.T, _ rpc.ServerCall, pairingToken string) error
}

ClaimableServerMethods is the interface a server writer implements for Claimable.

Claimable represents an uninitialized device with no owner (i.e., a device that has no blessings).

Claim is used to claim ownership by blessing the device's private key. Devices that have provided a pairing token to the claimer through an out-of-band communication channel (eg: display/email) would expect this pairing token to be replayed by the claimer.

Once claimed, the device will export the "Device" interface and all methods will be restricted to the claimer.

The blessings that the device is to be claimed with is provided via the ipc.Granter option in Go.

type ClaimableServerStub

type ClaimableServerStub interface {
	ClaimableServerStubMethods
	// Describe the Claimable interfaces.
	Describe__() []rpc.InterfaceDesc
}

ClaimableServerStub adds universal methods to ClaimableServerStubMethods.

func ClaimableServer

func ClaimableServer(impl ClaimableServerMethods) ClaimableServerStub

ClaimableServer returns a server stub for Claimable. It converts an implementation of ClaimableServerMethods into an object that may be used by rpc.Server.

type ClaimableServerStubMethods

type ClaimableServerStubMethods ClaimableServerMethods

ClaimableServerStubMethods is the server interface containing Claimable methods, as expected by rpc.Server. There is no difference between this interface and ClaimableServerMethods since there are no streaming methods.

type Config

type Config map[string]string

Config specifies app configuration that overrides what's in the envelope.

func (Config) VDLIsZero

func (x Config) VDLIsZero() bool

func (*Config) VDLRead

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

func (Config) VDLWrite

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

type Description

type Description struct {
	// Profiles is a set of names of supported profiles.	Each name can
	// either be an object name that resolves to a Profile, or can be the
	// profile's label, e.g.:
	//   "profiles/google/cluster/diskfull"
	//   "linux-media"
	//
	// Profiles for devices can be provided by hand, but they can also be
	// automatically derived by examining the device.
	Profiles map[string]struct{}
}

Description enumerates the profiles that a Device supports.

func (Description) VDLIsZero

func (x Description) VDLIsZero() bool

func (*Description) VDLRead

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

func (Description) VDLWrite

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

type DeviceClientMethods

type DeviceClientMethods interface {
	// Application can be used to manage applications on a device. This interface
	// will be invoked using an object name that identifies the application and its
	// installations and instances where applicable.
	//
	// An application is defined by a title.  An application can have multiple
	// installations on a device.  The installations are grouped under the same
	// application, but are otherwise independent of each other.  Each installation
	// can have zero or more instances (which can be running or not).  The instances
	// are independent of each other, and do not share state (like local storage).
	// Interaction among instances should occur via Vanadium RPC, facilitated by the
	// local mounttable.
	//
	// The device manager supports versioning of applications.  Each installation
	// maintains a tree of versions, where a version is defined by a specific
	// envelope.  The tree structure comes from 'previous version' references: each
	// version (except the initial installation version) maintains a reference to
	// the version that preceded it.  The installation maintains a current version
	// reference that is used for new instances.  Each update operation on the
	// installation creates a new version, sets the previous reference of the new
	// version to the current version, and then updates the current version to refer
	// to the new version.  Each revert operation on the installation sets the
	// current version to the previous version of the current version.  Each
	// instance maintains a current version reference that is used to run the
	// instance.  The initial version of the instance is set to the current version
	// of the installation at the time of instantiation.  Each update operation on
	// the instance updates the instance's current version to the current version of
	// the installation.  Each revert operation on the instance updates the
	// instance's current version to the previous version of the instance's version.
	//
	// The Application interface methods can be divided based on their intended
	// receiver:
	//
	// 1) Method receiver is an application:
	//     - Install()
	//
	// 2) Method receiver is an application installation:
	//     - Instantiate()
	//     - Uninstall()
	//
	// 3) Method receiver is an application instance:
	//     - Run()
	//     - Kill()
	//     - Delete()
	//
	// 4) Method receiver is an application installation or instance:
	//     - Update()
	//     - Revert()
	//
	// The following methods complement one another:
	//     - Install() and Uninstall()
	//     - Instantiate() and Delete()
	//     - Run() and Kill()
	//     - Update() and Revert()
	//
	//
	//
	// Examples:
	//
	// Install Google Maps on the device.
	//     device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/0"
	//
	// Create and start an instance of the previously installed maps application
	// installation.
	//    device/apps/google maps/0.Instantiate() --> { "0" }
	//    device/apps/google maps/0/0.Run()
	//
	// Create and start a second instance of the previously installed maps
	// application installation.
	//    device/apps/google maps/0.Instantiate() --> { "1" }
	//    device/apps/google maps/0/1.Run()
	//
	// Kill and delete the first instance previously started.
	//    device/apps/google maps/0/0.Kill()
	//    device/apps/google maps/0/0.Delete()
	//
	// Install a second Google Maps installation.
	//    device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/1"
	//
	// Update the second maps installation to the latest version available.
	//    device/apps/google maps/1.Update()
	//
	// Update the first maps installation to a specific version.
	//    device/apps/google maps/0.UpdateTo("/google.com/appstore/beta/maps")
	//
	// Finally, an application installation instance can be in one of three abstract
	// states: 1) "does not exist/deleted", 2) "running", or 3) "not-running". The
	// interface methods transition between these abstract states using the
	// following state machine:
	//
	//    apply(Instantiate(), "does not exist") = "not-running"
	//    apply(Run(), "not-running") = "running"
	//    apply(Kill(), "running") = "not-running"
	//    apply(Delete(), "not-running") = "deleted"
	ApplicationClientMethods
	// Tidyable specifies that a service can be tidied.
	tidyable.TidyableClientMethods
	// Describe generates a description of the device.
	Describe(*context.T, ...rpc.CallOpt) (Description, error)
	// IsRunnable checks if the device can execute the given binary.
	IsRunnable(_ *context.T, description binary.Description, _ ...rpc.CallOpt) (bool, error)
	// Reset resets the device. If the deadline is non-zero and the device
	// in question is still running after the given deadline expired,
	// reset of the device is enforced.
	Reset(_ *context.T, deadline time.Duration, _ ...rpc.CallOpt) error
	// AssociateAccount associates a local  system account name with the provided
	// Vanadium identities. It replaces the existing association if one already exists for that
	// identity. Setting an AccountName to "" removes the association for each
	// listed identity.
	AssociateAccount(_ *context.T, identityNames []string, accountName string, _ ...rpc.CallOpt) error
	// ListAssociations returns all of the associations between Vanadium identities
	// and system names.
	ListAssociations(*context.T, ...rpc.CallOpt) ([]Association, error)
}

DeviceClientMethods is the client interface containing Device methods.

Device can be used to manage a device remotely using an object name that identifies it.

type DeviceClientStub

type DeviceClientStub interface {
	DeviceClientMethods
	rpc.UniversalServiceMethods
}

DeviceClientStub adds universal methods to DeviceClientMethods.

func DeviceClient

func DeviceClient(name string) DeviceClientStub

DeviceClient returns a client stub for Device.

type DeviceServerMethods

type DeviceServerMethods interface {
	// Application can be used to manage applications on a device. This interface
	// will be invoked using an object name that identifies the application and its
	// installations and instances where applicable.
	//
	// An application is defined by a title.  An application can have multiple
	// installations on a device.  The installations are grouped under the same
	// application, but are otherwise independent of each other.  Each installation
	// can have zero or more instances (which can be running or not).  The instances
	// are independent of each other, and do not share state (like local storage).
	// Interaction among instances should occur via Vanadium RPC, facilitated by the
	// local mounttable.
	//
	// The device manager supports versioning of applications.  Each installation
	// maintains a tree of versions, where a version is defined by a specific
	// envelope.  The tree structure comes from 'previous version' references: each
	// version (except the initial installation version) maintains a reference to
	// the version that preceded it.  The installation maintains a current version
	// reference that is used for new instances.  Each update operation on the
	// installation creates a new version, sets the previous reference of the new
	// version to the current version, and then updates the current version to refer
	// to the new version.  Each revert operation on the installation sets the
	// current version to the previous version of the current version.  Each
	// instance maintains a current version reference that is used to run the
	// instance.  The initial version of the instance is set to the current version
	// of the installation at the time of instantiation.  Each update operation on
	// the instance updates the instance's current version to the current version of
	// the installation.  Each revert operation on the instance updates the
	// instance's current version to the previous version of the instance's version.
	//
	// The Application interface methods can be divided based on their intended
	// receiver:
	//
	// 1) Method receiver is an application:
	//     - Install()
	//
	// 2) Method receiver is an application installation:
	//     - Instantiate()
	//     - Uninstall()
	//
	// 3) Method receiver is an application instance:
	//     - Run()
	//     - Kill()
	//     - Delete()
	//
	// 4) Method receiver is an application installation or instance:
	//     - Update()
	//     - Revert()
	//
	// The following methods complement one another:
	//     - Install() and Uninstall()
	//     - Instantiate() and Delete()
	//     - Run() and Kill()
	//     - Update() and Revert()
	//
	//
	//
	// Examples:
	//
	// Install Google Maps on the device.
	//     device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/0"
	//
	// Create and start an instance of the previously installed maps application
	// installation.
	//    device/apps/google maps/0.Instantiate() --> { "0" }
	//    device/apps/google maps/0/0.Run()
	//
	// Create and start a second instance of the previously installed maps
	// application installation.
	//    device/apps/google maps/0.Instantiate() --> { "1" }
	//    device/apps/google maps/0/1.Run()
	//
	// Kill and delete the first instance previously started.
	//    device/apps/google maps/0/0.Kill()
	//    device/apps/google maps/0/0.Delete()
	//
	// Install a second Google Maps installation.
	//    device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/1"
	//
	// Update the second maps installation to the latest version available.
	//    device/apps/google maps/1.Update()
	//
	// Update the first maps installation to a specific version.
	//    device/apps/google maps/0.UpdateTo("/google.com/appstore/beta/maps")
	//
	// Finally, an application installation instance can be in one of three abstract
	// states: 1) "does not exist/deleted", 2) "running", or 3) "not-running". The
	// interface methods transition between these abstract states using the
	// following state machine:
	//
	//    apply(Instantiate(), "does not exist") = "not-running"
	//    apply(Run(), "not-running") = "running"
	//    apply(Kill(), "running") = "not-running"
	//    apply(Delete(), "not-running") = "deleted"
	ApplicationServerMethods
	// Tidyable specifies that a service can be tidied.
	tidyable.TidyableServerMethods
	// Describe generates a description of the device.
	Describe(*context.T, rpc.ServerCall) (Description, error)
	// IsRunnable checks if the device can execute the given binary.
	IsRunnable(_ *context.T, _ rpc.ServerCall, description binary.Description) (bool, error)
	// Reset resets the device. If the deadline is non-zero and the device
	// in question is still running after the given deadline expired,
	// reset of the device is enforced.
	Reset(_ *context.T, _ rpc.ServerCall, deadline time.Duration) error
	// AssociateAccount associates a local  system account name with the provided
	// Vanadium identities. It replaces the existing association if one already exists for that
	// identity. Setting an AccountName to "" removes the association for each
	// listed identity.
	AssociateAccount(_ *context.T, _ rpc.ServerCall, identityNames []string, accountName string) error
	// ListAssociations returns all of the associations between Vanadium identities
	// and system names.
	ListAssociations(*context.T, rpc.ServerCall) ([]Association, error)
}

DeviceServerMethods is the interface a server writer implements for Device.

Device can be used to manage a device remotely using an object name that identifies it.

type DeviceServerStub

type DeviceServerStub interface {
	DeviceServerStubMethods
	// Describe the Device interfaces.
	Describe__() []rpc.InterfaceDesc
}

DeviceServerStub adds universal methods to DeviceServerStubMethods.

func DeviceServer

func DeviceServer(impl DeviceServerMethods) DeviceServerStub

DeviceServer returns a server stub for Device. It converts an implementation of DeviceServerMethods into an object that may be used by rpc.Server.

type DeviceServerStubMethods

type DeviceServerStubMethods interface {
	// Application can be used to manage applications on a device. This interface
	// will be invoked using an object name that identifies the application and its
	// installations and instances where applicable.
	//
	// An application is defined by a title.  An application can have multiple
	// installations on a device.  The installations are grouped under the same
	// application, but are otherwise independent of each other.  Each installation
	// can have zero or more instances (which can be running or not).  The instances
	// are independent of each other, and do not share state (like local storage).
	// Interaction among instances should occur via Vanadium RPC, facilitated by the
	// local mounttable.
	//
	// The device manager supports versioning of applications.  Each installation
	// maintains a tree of versions, where a version is defined by a specific
	// envelope.  The tree structure comes from 'previous version' references: each
	// version (except the initial installation version) maintains a reference to
	// the version that preceded it.  The installation maintains a current version
	// reference that is used for new instances.  Each update operation on the
	// installation creates a new version, sets the previous reference of the new
	// version to the current version, and then updates the current version to refer
	// to the new version.  Each revert operation on the installation sets the
	// current version to the previous version of the current version.  Each
	// instance maintains a current version reference that is used to run the
	// instance.  The initial version of the instance is set to the current version
	// of the installation at the time of instantiation.  Each update operation on
	// the instance updates the instance's current version to the current version of
	// the installation.  Each revert operation on the instance updates the
	// instance's current version to the previous version of the instance's version.
	//
	// The Application interface methods can be divided based on their intended
	// receiver:
	//
	// 1) Method receiver is an application:
	//     - Install()
	//
	// 2) Method receiver is an application installation:
	//     - Instantiate()
	//     - Uninstall()
	//
	// 3) Method receiver is an application instance:
	//     - Run()
	//     - Kill()
	//     - Delete()
	//
	// 4) Method receiver is an application installation or instance:
	//     - Update()
	//     - Revert()
	//
	// The following methods complement one another:
	//     - Install() and Uninstall()
	//     - Instantiate() and Delete()
	//     - Run() and Kill()
	//     - Update() and Revert()
	//
	//
	//
	// Examples:
	//
	// Install Google Maps on the device.
	//     device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/0"
	//
	// Create and start an instance of the previously installed maps application
	// installation.
	//    device/apps/google maps/0.Instantiate() --> { "0" }
	//    device/apps/google maps/0/0.Run()
	//
	// Create and start a second instance of the previously installed maps
	// application installation.
	//    device/apps/google maps/0.Instantiate() --> { "1" }
	//    device/apps/google maps/0/1.Run()
	//
	// Kill and delete the first instance previously started.
	//    device/apps/google maps/0/0.Kill()
	//    device/apps/google maps/0/0.Delete()
	//
	// Install a second Google Maps installation.
	//    device/apps.Install("/google.com/appstore/maps", nil, nil) --> "google maps/1"
	//
	// Update the second maps installation to the latest version available.
	//    device/apps/google maps/1.Update()
	//
	// Update the first maps installation to a specific version.
	//    device/apps/google maps/0.UpdateTo("/google.com/appstore/beta/maps")
	//
	// Finally, an application installation instance can be in one of three abstract
	// states: 1) "does not exist/deleted", 2) "running", or 3) "not-running". The
	// interface methods transition between these abstract states using the
	// following state machine:
	//
	//    apply(Instantiate(), "does not exist") = "not-running"
	//    apply(Run(), "not-running") = "running"
	//    apply(Kill(), "running") = "not-running"
	//    apply(Delete(), "not-running") = "deleted"
	ApplicationServerStubMethods
	// Tidyable specifies that a service can be tidied.
	tidyable.TidyableServerStubMethods
	// Describe generates a description of the device.
	Describe(*context.T, rpc.ServerCall) (Description, error)
	// IsRunnable checks if the device can execute the given binary.
	IsRunnable(_ *context.T, _ rpc.ServerCall, description binary.Description) (bool, error)
	// Reset resets the device. If the deadline is non-zero and the device
	// in question is still running after the given deadline expired,
	// reset of the device is enforced.
	Reset(_ *context.T, _ rpc.ServerCall, deadline time.Duration) error
	// AssociateAccount associates a local  system account name with the provided
	// Vanadium identities. It replaces the existing association if one already exists for that
	// identity. Setting an AccountName to "" removes the association for each
	// listed identity.
	AssociateAccount(_ *context.T, _ rpc.ServerCall, identityNames []string, accountName string) error
	// ListAssociations returns all of the associations between Vanadium identities
	// and system names.
	ListAssociations(*context.T, rpc.ServerCall) ([]Association, error)
}

DeviceServerStubMethods is the server interface containing Device methods, as expected by rpc.Server. The only difference between this interface and DeviceServerMethods is the streaming methods.

type DeviceStatus

type DeviceStatus struct {
	State   InstanceState
	Version string
}

DeviceStatus specifies the Status returned by the Application Status method for the device service object.

func (DeviceStatus) VDLIsZero

func (x DeviceStatus) VDLIsZero() bool

func (*DeviceStatus) VDLRead

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

func (DeviceStatus) VDLWrite

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

type InstallationState

type InstallationState int

InstallationState describes the states that an installation can be in at any time.

const (
	InstallationStateActive InstallationState = iota
	InstallationStateUninstalled
)

func InstallationStateFromString

func InstallationStateFromString(label string) (x InstallationState, err error)

InstallationStateFromString creates a InstallationState from a string label.

func (*InstallationState) Set

func (x *InstallationState) Set(label string) error

Set assigns label to x.

func (InstallationState) String

func (x InstallationState) String() string

String returns the string label of x.

func (InstallationState) VDLIsZero

func (x InstallationState) VDLIsZero() bool

func (*InstallationState) VDLRead

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

func (InstallationState) VDLWrite

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

type InstallationStatus

type InstallationStatus struct {
	State   InstallationState
	Version string
}

InstallationStatus specifies the Status returned by the Application Status method for installation objects.

func (InstallationStatus) VDLIsZero

func (x InstallationStatus) VDLIsZero() bool

func (*InstallationStatus) VDLRead

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

func (InstallationStatus) VDLWrite

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

type InstanceState

type InstanceState int

InstanceState describes the states that an instance can be in at any time.

const (
	InstanceStateLaunching InstanceState = iota
	InstanceStateRunning
	InstanceStateDying
	InstanceStateNotRunning
	InstanceStateUpdating
	InstanceStateDeleted
)

func InstanceStateFromString

func InstanceStateFromString(label string) (x InstanceState, err error)

InstanceStateFromString creates a InstanceState from a string label.

func (*InstanceState) Set

func (x *InstanceState) Set(label string) error

Set assigns label to x.

func (InstanceState) String

func (x InstanceState) String() string

String returns the string label of x.

func (InstanceState) VDLIsZero

func (x InstanceState) VDLIsZero() bool

func (*InstanceState) VDLRead

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

func (InstanceState) VDLWrite

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

type InstanceStatus

type InstanceStatus struct {
	State   InstanceState
	Version string
}

InstanceStatus specifies the Status returned by the Application Status method for instance objects.

func (InstanceStatus) VDLIsZero

func (x InstanceStatus) VDLIsZero() bool

func (*InstanceStatus) VDLRead

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

func (InstanceStatus) VDLWrite

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

type Status

type Status interface {
	// Index returns the field index.
	Index() int
	// Interface returns the field value as an interface.
	Interface() interface{}
	// Name returns the field name.
	Name() string

	VDLIsZero() bool
	VDLWrite(vdl.Encoder) error
	// contains filtered or unexported methods
}

Status represents any single field of the Status union type.

Status is returned by the Application Status method.

type StatusDevice

type StatusDevice struct{ Value DeviceStatus }

StatusDevice represents field Device of the Status union type.

func (StatusDevice) Index

func (x StatusDevice) Index() int

func (StatusDevice) Interface

func (x StatusDevice) Interface() interface{}

func (StatusDevice) Name

func (x StatusDevice) Name() string

func (StatusDevice) VDLIsZero

func (x StatusDevice) VDLIsZero() bool

func (StatusDevice) VDLWrite

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

type StatusInstallation

type StatusInstallation struct{ Value InstallationStatus }

StatusInstallation represents field Installation of the Status union type.

func (StatusInstallation) Index

func (x StatusInstallation) Index() int

func (StatusInstallation) Interface

func (x StatusInstallation) Interface() interface{}

func (StatusInstallation) Name

func (x StatusInstallation) Name() string

func (StatusInstallation) VDLIsZero

func (x StatusInstallation) VDLIsZero() bool

func (StatusInstallation) VDLWrite

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

type StatusInstance

type StatusInstance struct{ Value InstanceStatus }

StatusInstance represents field Instance of the Status union type.

func (StatusInstance) Index

func (x StatusInstance) Index() int

func (StatusInstance) Interface

func (x StatusInstance) Interface() interface{}

func (StatusInstance) Name

func (x StatusInstance) Name() string

func (StatusInstance) VDLIsZero

func (x StatusInstance) VDLIsZero() bool

func (StatusInstance) VDLWrite

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

Jump to

Keyboard shortcuts

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