impl

package
v0.0.0-...-ff5f600 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2016 License: BSD-3-Clause Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShellPath   = "/bin/bash"
	DateCommand = "/bin/date +%s%N"
)

Variables

View Source
var AutomaticTidyingInterval = time.Hour * 24

AutomaticTidyingInterval defaults to 1 day. Settable for tests.

View Source
var CleanupDir = BaseCleanupDir

CleanupDir is defined like this so we can override its implementation for tests. CleanupDir will use the helper to delete application state possibly owned by different accounts if helper is provided.

View Source
var Describe = func() (device.Description, error) {
	empty := device.Description{}
	deviceProfile, err := ComputeDeviceProfile()
	if err != nil {
		return empty, err
	}
	knownProfiles, err := profiles.GetKnownProfiles()
	if err != nil {
		return empty, err
	}
	result := matchProfiles(deviceProfile, knownProfiles)
	if len(result.Profiles) == 0 {

		result.Profiles["unknown"] = struct{}{}
	}
	return result, nil
}

Describe returns a Description containing the profile that matches the current device. It's declared as a variable so we can override it for testing.

View Source
var IsSetuid = func(ctx *context.T, fileStat os.FileInfo) bool {
	ctx.VI(2).Infof("running the original isSetuid")
	return fileStat.Mode()&os.ModeSetuid == os.ModeSetuid
}

IsSetuid is defined like this so we can override its implementation for tests.

View Source
var MockableNow = time.Now

Exposed for replacability in tests.

Functions

func BaseCleanupDir

func BaseCleanupDir(ctx *context.T, path, helper string)

func ComputeDeviceProfile

func ComputeDeviceProfile() (*profile.Specification, error)

ComputeDeviceProfile generates a description of the runtime environment (supported file format, OS, architecture, libraries) of the host device.

TODO(jsimsa): Avoid computing the host device description from scratch if a recent cached copy exists.

func DeleteFileTree

func DeleteFileTree(ctx *context.T, dirOrFile string, stdout, stderr io.Writer) error

func GenerateScript

func GenerateScript(workspace string, configSettings []string, envelope *application.Envelope, logs string) error

func InitSuidHelper

func InitSuidHelper(ctx *context.T, helperPath string)

func InvokeCallback

func InvokeCallback(ctx *context.T, name string)

InvokeCallback provides the parent device manager with the given name (which is expected to be this device manager's object name).

func LinkSelf

func LinkSelf(workspace, fileName string) error

LinkSelf creates a link to the current binary.

func NewDispatcher

func NewDispatcher(ctx *context.T, config *config.State, mtAddress string, testMode bool, restartHandler func(), permStore *pathperms.PathStore) (rpc.Dispatcher, func(), error)

NewDispatcher is the device manager dispatcher factory. It returns a new dispatcher as well as a shutdown function, to be called when the dispatcher is no longer needed.

func PermsDir

func PermsDir(c *config.State) string

func RunningChildrenProcesses

func RunningChildrenProcesses() bool

RunningChildrenProcesses uses the reaper to verify that a test has successfully shut down all processes.

func SaveManagerInfo

func SaveManagerInfo(dir string, info *ManagerInfo) error

func SavePersistentArgs

func SavePersistentArgs(root string, args []string) error
func UpdateLink(target, link string) error

func VanadiumEnvironment

func VanadiumEnvironment(env []string) []string

VanadiumEnvironment returns only the environment variables that are specific to the Vanadium system.

Types

type BlessingSystemAssociationStore

type BlessingSystemAssociationStore interface {
	// SystemAccountForBlessings returns a system name from the blessing to
	// system name association store if one exists for any of the listed
	// blessings.
	SystemAccountForBlessings(blessings []string) (string, bool)

	// AllBlessingSystemAssociations returns all of the current Blessing to system
	// account associations.
	AllBlessingSystemAssociations() ([]device.Association, error)

	// AssociateSystemAccountForBlessings associates the provided systenName with each
	// provided blessing.
	AssociateSystemAccountForBlessings(blessings []string, systemName string) error

	// DisassociateSystemAccountForBlessings removes associations for the provided blessings.
	DisassociateSystemAccountForBlessings(blessings []string) error
}

BlessingSystemAssociationStore manages a persisted association between Vanadium blessings and system account names.

func NewBlessingSystemAssociationStore

func NewBlessingSystemAssociationStore(root string) (BlessingSystemAssociationStore, error)

type ManagerInfo

type ManagerInfo struct {
	Pid int
}

ManagerInfo holds state about a running device manager or a running restarter

func LoadManagerInfo

func LoadManagerInfo(dir string) (*ManagerInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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