status

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	// RegistryItems contains the status of all of the applications in the registry
	RegistryItems map[string]RegistryApplication
)

Functions

func CheckStatus

func CheckStatus(catalogItem catalog.Item, installType, cachePath string) (actionNeeded bool, checkErr error)

CheckStatus determines the method for checking status

Example (File)

ExampleCheckStatus_file validates that a file check is ran

// Override execCommand with our fake version
execCommand = fakeExecCommand
// Override the verbose setting
gorillalog.NewLog(cfgVerbose)
defer func() {
	execCommand = origExec
}()

// Run CheckStatus with an item that has a script check
CheckStatus(fileCheckItem, "install", "testdata/")
Output:

Checking status via file: fileCheckItem
Example (None)

ExampleCheckStatus_none validates that no check is ran

// Override execCommand with our fake version
execCommand = fakeExecCommand
// Override the verbose setting
gorillalog.NewLog(cfgVerbose)
defer func() {
	execCommand = origExec
}()

// Run CheckStatus with an item that has a script check
CheckStatus(noCheckItem, "install", "testdata/")
Output:

Not enough data to check the current status: noCheckItem
Example (Registry)

ExampleCheckStatus_registry validates that a registry check is ran

// Override execCommand with our fake version
execCommand = fakeExecCommand
// Override the verbose setting
gorillalog.NewLog(cfgVerbose)
defer func() {
	execCommand = origExec
}()

// Run CheckStatus with an item that has a script check
CheckStatus(registryCheckItem, "install", "testdata/")
Output:

Checking status via registry: registryCheckItem
Example (Script)

ExampleCheckStatus_script validates that a script check is ran

// Override execCommand with our fake version
execCommand = fakeExecCommand
// Override the verbose setting
gorillalog.NewLog(cfgVerbose)
defer func() {
	execCommand = origExec
}()

// Run CheckStatus with an item that has a script check
CheckStatus(scriptCheckItem, "install", "testdata/")
Output:

Checking status via script: scriptCheckItem

Types

type RegistryApplication

type RegistryApplication struct {
	Key       string
	Location  string
	Name      string
	Source    string
	Uninstall string
	Version   string
}

RegistryApplication contains attributes for an installed application

type WindowsMetadata

type WindowsMetadata struct {
	// contains filtered or unexported fields
}

WindowsMetadata contains extended metadata retrieved in the `properties.go`

func GetFileMetadata added in v1.5.0

func GetFileMetadata(path string) WindowsMetadata

GetFileMetadata is just a placeholder on darwin

Jump to

Keyboard shortcuts

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