Documentation
¶
Index ¶
- Constants
- func EqualFileAttributes(a, b FileAttributes) bool
- type Action
- type ActionType
- type AppDetection
- type AppEvaluation
- type AppID
- type AppList
- type AppMap
- type AppSummary
- type Application
- type Behavior
- type Command
- type CommandID
- type CommandMap
- type CommandResult
- type CommandType
- type Condition
- type ConditionCache
- type ConditionElement
- type ConditionError
- type ConditionID
- type ConditionList
- type ConditionMap
- type ConditionType
- type ConditionUse
- type Deployment
- type DeploymentID
- type DirRef
- type DirectoryResource
- type DirectoryResourceID
- type DirectoryResourceMap
- type DirectoryResourceSet
- type DirectoryType
- type ExecutableID
- type ExitCode
- type ExitCodeInfo
- type ExitCodeMap
- type FileAttributes
- type FileRef
- type FileResource
- type FileResourceID
- type FileResourceMap
- type FileSystemResources
- type Flow
- type FlowID
- type FlowMap
- type FlowStats
- type KnownFolder
- type KnownFolderMap
- type Lock
- type LockConflictRules
- type LockID
- type LockMap
- type MatchType
- type Mutex
- type MutexID
- type MutexMap
- type MutexName
- type MutexNamespace
- type OnErrorBehavior
- type Package
- type PackageContent
- type PackageFile
- type PackageFileID
- type PackageFileMap
- type PackageFormat
- type PackageID
- type PackageMap
- type PackageSource
- type PackageSourceType
- type PackageType
- type ProcessAttributeID
- type ProcessMatch
- type ProcessResource
- type ProcessResourceID
- type ProcessResourceMap
- type ProductCode
- type RegistryKeyRef
- type RegistryKeyResource
- type RegistryKeyResourceID
- type RegistryKeyResourceMap
- type RegistryKeyResourceSet
- type RegistryResources
- type RegistryRoot
- type RegistryRootMap
- type RegistryValueRef
- type RegistryValueResource
- type RegistryValueResourceID
- type RegistryValueResourceMap
- type Resources
Constants ¶
const ( CommandTypeExe = "exe" CommandTypeMSIInstall = "msi-install" CommandTypeMSIUpdate = "msi-update" CommandTypeMSIUninstall = "msi-uninstall" CommandTypeMSIUninstallProductCode = "msi-uninstall-product-code" )
Command types.
Variables ¶
This section is empty.
Functions ¶
func EqualFileAttributes ¶
func EqualFileAttributes(a, b FileAttributes) bool
EqualFileAttributes returns true if a and b have identical sizes and identical sets of file hashes.
Types ¶
type Action ¶
type Action struct {
Type ActionType `json:"action"`
Package PackageID `json:"package,omitempty"`
Command CommandID `json:"command,omitempty"`
Force bool `json:"force,omitempty"`
Flow FlowID `json:"flow,omitempty"`
SourceFile FileResourceID `json:"source-file,omitempty"`
SourceDir DirectoryResourceID `json:"source-directory,omitempty"`
DestinationFile FileResourceID `json:"destination-file,omitempty"`
DestinationDir DirectoryResourceID `json:"destination-directory,omitempty"`
}
Action describes an action to be taken as part of a flow.
type ActionType ¶
type ActionType string
ActionType identifies the type of action.
const ( ActionStartFlow ActionType = "start-flow" ActionPreparePackage ActionType = "prepare-package" ActionInvokeCommand ActionType = "invoke-command" ActionCopyFile ActionType = "copy-file" ActionDeleteFile ActionType = "delete-file" )
Recognized action types.
type AppDetection ¶
type AppDetection struct {
Present ConditionID `json:"present,omitempty"`
Version RegistryValueResourceID `json:"version,omitempty"`
}
AppDetection describes how to detect the presence of an installed application and how to determine what version is installed.
type AppEvaluation ¶
type AppEvaluation struct {
AlreadyInstalled AppList
AlreadyUninstalled AppList
ToInstall AppList
ToUninstall AppList
}
AppEvaluation is an evaluation of potential changes to the set of installed applications.
func (AppEvaluation) ActionsNeeded ¶
func (e AppEvaluation) ActionsNeeded() bool
ActionsNeeded returns true if any apps need to be installed or uninstalled.
func (AppEvaluation) IsZero ¶
func (e AppEvaluation) IsZero() bool
IsZero returns true if the app evaluation is empty.
type AppList ¶
type AppList []AppID
AppList is a list of relevant applications for a deployment.
func (AppList) Difference ¶
Difference returns all members of list that are not members of other.
type AppMap ¶
type AppMap map[AppID]Application
AppMap holds a set of applications mapped by their identifiers.
It is used to identify relevant applications for a deployment.
type AppSummary ¶
type AppSummary struct {
Installed AppList
Uninstalled AppList
StillNotInstalled AppList
StillNotUninstalled AppList
}
AppSummary is a summary of changes to the set of installed applications.
func (AppSummary) Err ¶
func (s AppSummary) Err() error
Err returns a non-nil error if any of the expected application changes did not take effect.
func (AppSummary) IsZero ¶
func (s AppSummary) IsZero() bool
IsZero returns true if the app summary is empty.
type Application ¶
type Application struct {
Name string `json:"name"`
Architecture appcode.Architecture `json:"architecture,omitempty"`
Scope appscope.Scope `json:"scope,omitempty"`
ProductCode ProductCode `json:"product-code,omitempty"`
Detection AppDetection `json:"detection,omitempty"`
}
Application hold identifying information for an application.
If it defines an architecture, scope and unpackaged app ID, these will be used to determine if the application is installed in the Windows app registry.
Alternatively, a condition may be specified that determines whether the application is installed.
type Behavior ¶
type Behavior struct {
OnError OnErrorBehavior `json:"on-error,omitempty"`
}
Behavior describes behavior modifications for a deployment or flow.
func OverlayBehavior ¶
OverlayBehavior overlays the given set of behaviors, giving priority to later members.
type Command ¶
type Command struct {
// Installs is a list of applications that the command installs.
Installs AppList `json:"installs,omitzero"`
// Uninstalls is a list of applicaitons that the command uninstalls.
Uninstalls AppList `json:"uninstalls,omitzero"`
// Type is the type of command to be run.
Type CommandType `json:"type,omitempty"`
// WorkingDirectory specifies a working directory for a command. If no
// working directory is specified, the directory containing the executable
// will be used.
WorkingDirectory DirectoryResourceID `json:"working-directory,omitempty"`
// Executable identifies an executable file to be run.
//
// For commands applied to archive packages, it identifies the executable
// file within the archive, and will be interpreted as a PackageFileID.
//
// For non-pacakge commands, it identifies the executable file to be
// invoked, and will be interpreted as a FileResourceID.
//
// For msi-based commands, the file will be provided to the msiexec
// utility.
Executable ExecutableID `json:"executable,omitempty"`
// Args is the set of arguments to be passed to the command.
Args []string `json:"args,omitzero"`
// ExitCodes provide a map of known exit codes for the command.
ExitCodes ExitCodeMap `json:"exit-codes,omitzero"`
}
Command defines a command that can be invoked for a deployment or package.
TODO: Support variable expansion when building arguments.
type CommandMap ¶
CommandMap defines a set of commands that can be issued, mapped by their identifiers.
type CommandResult ¶
type CommandResult struct {
ExitCode ExitCode
Info ExitCodeInfo
}
CommandResult stores information about an exit code returned by a command.
func (CommandResult) String ¶
func (r CommandResult) String() string
String returns a string representation of the command result.
type CommandType ¶
type CommandType string
CommandType identifies the type of a command.
func (CommandType) IsAppBased ¶
func (t CommandType) IsAppBased() bool
IsAppBased returns true if the command applies to an application's product code, and not to a provided executable or installer file.
func (CommandType) IsMSI ¶
func (t CommandType) IsMSI() bool
IsMSI returns true if the command invokes msiexec.
type Condition ¶
type Condition struct {
Label string `json:"label,omitempty"`
Type ConditionType `json:"type,omitempty"`
Subject string `json:"subject,omitempty"`
Comparison lbvalue.Comparison `json:"comparison,omitzero"`
Value lbvalue.Value `json:"value,omitzero"`
Negated bool `json:"negated,omitempty"`
Any []Condition `json:"any,omitzero"`
All []Condition `json:"all,omitzero"`
Violation string `json:"violation,omitempty"`
}
Condition describes a condition that can be evaluated.
type ConditionCache ¶
type ConditionCache map[ConditionID]bool
ConditionCache holds a cache of evaluated conditions.
type ConditionElement ¶
type ConditionElement int
ConditionElement identifies an element of a condition.
const ( ConditionElementSelf ConditionElement = iota ConditionElementAny ConditionElementAll )
Elements of a condition that can lead to an error.
type ConditionError ¶
type ConditionError struct {
ID ConditionID
Label string
Type ConditionType
Element ConditionElement
SubCondition int
Err error
}
ConditionError is returned when a condition fails due to an error.
func (ConditionError) Error ¶
func (e ConditionError) Error() string
Error returns the error as a string.
func (ConditionError) Unwrap ¶
func (e ConditionError) Unwrap() error
Unwrap returns the underlying error for the condition.
type ConditionList ¶
type ConditionList []ConditionID
ConditionList is a list of condition IDs.
func (ConditionList) String ¶
func (list ConditionList) String() string
String returns a string representation of the list.
type ConditionMap ¶
type ConditionMap map[ConditionID]Condition
ConditionMap holds a set of conditions mapped by their identifiers.
type ConditionType ¶
type ConditionType string
ConditionType identifies a type of condition.
const ( ConditionTypeSubcondition ConditionType = "condition" ConditionTypeProcessIsRunning ConditionType = "resource.process:running" ConditionTypeMutexExists ConditionType = "resource.mutex:exists" ConditionTypeRegistryKeyExists ConditionType = "resource.registry.key:exists" ConditionTypeRegistryValueExists ConditionType = "resource.registry.value:exists" ConditionTypeRegistryValueComparison ConditionType = "resource.registry.value:comparison" ConditionTypeDirectoryExists ConditionType = "resource.file-system.directory:exists" ConditionTypeFileExists ConditionType = "resource.file-system.file:exists" )
Supported condition types.
type ConditionUse ¶
type ConditionUse string
ConditionUse identifies common uses of a condition.
const ( ConditionUseConstraint ConditionUse = "constraint" ConditionUsePrecondition ConditionUse = "precondition" )
func (ConditionUse) Plural ¶
func (use ConditionUse) Plural() string
Plural returns the use in plural form.
func (ConditionUse) String ¶
func (use ConditionUse) String() string
String returns a string representation of the use.
type Deployment ¶
type Deployment struct {
ID DeploymentID `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Behavior Behavior `json:"behavior,omitzero"`
Apps AppMap `json:"apps,omitzero"`
Conditions ConditionMap `json:"conditions,omitzero"`
Commands CommandMap `json:"commands,omitzero"`
Resources Resources `json:"resources,omitzero"`
Flows FlowMap `json:"flows,omitzero"`
}
Deployment defines a deployment package.
func (Deployment) Validate ¶
func (dep Deployment) Validate() error
Validate returns an error if the deployment contains invalid configuration.
func (Deployment) ValidateCondition ¶
func (dep Deployment) ValidateCondition(condition ConditionID) error
ValidateCondition returns an error if the given condition is not valid.
type DeploymentID ¶
type DeploymentID string
DeploymentID is a unique identifier for a deployment.
func (DeploymentID) Validate ¶
func (id DeploymentID) Validate() error
Validate returns a non-nil error if the deployment ID is invalid.
type DirRef ¶
type DirRef struct {
Root KnownFolder
Lineage []DirectoryResource
}
DirRef is a resolved reference to a directory on the local file system.
type DirectoryResource ¶
type DirectoryResource struct {
Location DirectoryResourceID // A well-known directory, or another directory ID.
Path string // Relative to location
}
FileResource describes a directory resource.
type DirectoryResourceID ¶
type DirectoryResourceID string
DirectoryResourceID is a unique identifier for a directory resource.
type DirectoryResourceMap ¶
type DirectoryResourceMap map[DirectoryResourceID]DirectoryResource
DirectoryResourceMap holds a set of directory resources mapped by their identifiers.
type DirectoryResourceSet ¶
type DirectoryResourceSet = idset.SetOf[DirectoryResourceID]
DirectoryResourceSet holds a set of directory resource IDs.
type DirectoryType ¶
type DirectoryType string
DirectoryType declares the type of a directory resource.
type ExecutableID ¶
type ExecutableID string
ExecutableID is either a FileResourceID or a PackageFileID, depending on whether the command is a regular command or a package command.
type ExitCodeInfo ¶
type ExitCodeInfo struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
OK bool `json:"ok,omitempty"`
}
ExitCodeInfo stores information about an exit code.
type ExitCodeMap ¶
type ExitCodeMap map[ExitCode]ExitCodeInfo
ExitCodeMap defines a set of expected exit codes.
type FileAttributes ¶
FileAttributes store file size and cryptographic hash data for a file.
func (FileAttributes) Features ¶
func (attr FileAttributes) Features() (features []string)
Features returns a list of features that are present within the attributes.
func (FileAttributes) Validate ¶
func (attr FileAttributes) Validate() error
Validate returns a non-nil error if the file attributes are missing or invalid.
type FileRef ¶
type FileRef struct {
Root KnownFolder
Lineage []DirectoryResource
FileID FileResourceID
FilePath string
}
FileRef is a resolved reference to a file on the local file system.
type FileResource ¶
type FileResource struct {
Location DirectoryResourceID // A well-known directory, or another directory ID.
Path string // Relative to location
}
FileResource describes a file resource.
type FileResourceID ¶
type FileResourceID string
FileResourceID is a unique identifier for a file resource.
type FileResourceMap ¶
type FileResourceMap map[FileResourceID]FileResource
FileResourceMap holds a set of file resources mapped by their identifiers.
type FileSystemResources ¶
type FileSystemResources struct {
Directories DirectoryResourceMap `json:"directories,omitempty"`
Files FileResourceMap `json:"files,omitempty"`
}
FileSystemResources describes resources accessed through the file system, either local or remote.
func (FileSystemResources) ResolveDirectory ¶
func (fs FileSystemResources) ResolveDirectory(dir DirectoryResourceID) (ref DirRef, err error)
ResolveDirectory resolves the requested directory resource, returning a directory reference that can be mapped to a path on the local system.
Successfully resolving a directory resource means that its path on the local system can be determined, but it does not imply that the directory exists.
If the directory cannot be resolved, an error is returned.
func (FileSystemResources) ResolveFile ¶
func (fs FileSystemResources) ResolveFile(file FileResourceID) (ref FileRef, err error)
ResolveFile resolves the requested file resource, returning a file reference that can be mapped to a path on the local system.
Successfully resolving a file resource means that its path on the local system can be determined, but it does not imply that the file exists.
If the file cannot be resolved, an error is returned.
type Flow ¶
type Flow struct {
Constraints ConditionList `json:"constraints,omitzero"`
Preconditions ConditionList `json:"preconditions,omitzero"`
Locks []LockID `json:"locks,omitzero"`
Behavior Behavior `json:"behavior,omitzero"`
Actions []Action `json:"actions,omitzero"`
}
Flow is a flow of actions within a deployment.
TODO: Consider renaming "Preconditions" to "Requirements".
type KnownFolder ¶
type KnownFolder struct {
// contains filtered or unexported fields
}
KnownFolder is a folder with a known location.
func GetKnownFolder ¶
func GetKnownFolder(id DirectoryResourceID) (folder KnownFolder, ok bool)
GetKnownFolder looks for a known folder with the given directory resource ID. If one is found, it is returned and ok will be true.
func (KnownFolder) GUID ¶
func (kf KnownFolder) GUID() *windows.KNOWNFOLDERID
GUID returns the Known Folder ID in Windows.
func (KnownFolder) ID ¶
func (kf KnownFolder) ID() DirectoryResourceID
ID returns the LeafBridge directory ID of the known folder.
func (KnownFolder) IsZero ¶
func (kf KnownFolder) IsZero() bool
IsZero returns true if the known folder is undefined.
func (KnownFolder) Path ¶
func (kf KnownFolder) Path() (path string, err error)
Path retrieves the path to the known folder on the local system.
func (KnownFolder) Protected ¶
func (kf KnownFolder) Protected() bool
Protected returns true if the known folder is protected against modification.
type KnownFolderMap ¶
type KnownFolderMap map[DirectoryResourceID]KnownFolder
KnownFolderMap is a map of predefined directory resource IDs to known folder locations.
type Lock ¶
type Lock struct {
Description string `json:"description,omitempty"`
Mutex MutexID `json:"mutex,omitempty"`
ConflictRules LockConflictRules `json:"conflict,omitzero"`
}
Lock is a lockable resource that can be used to prevent invocations from competing or interfering with each other.
type LockConflictRules ¶
type LockConflictRules struct {
Message string `json:"message,omitempty"`
}
LockConflictRules provide guidance for what to do when a conflict is encountered on a lockable resource.
type Mutex ¶
type Mutex struct {
Description string `json:"description,omitempty"`
Name MutexName `json:"name"`
Namespace MutexNamespace `json:"namespace"`
}
Mutex is a system-wide mutex that can be evaluated by conditions or used by locks.
func (Mutex) ObjectName ¶
ObjectName returns the name of the mutex object in the Windows Object Manager.
type MutexName ¶
type MutexName string
MutexName is the name of a system-wide mutex on the machine a deployment is running on.
type MutexNamespace ¶
type MutexNamespace string
MutexNamespace is the namespace within a mutex exists. It can be "leafbridge", "global" or "system".
const ( LeafBridgeMutex MutexNamespace = "leafbridge" GlobalMutex MutexNamespace = "global" SessionMutex MutexNamespace = "session" )
Mutex namespaces.
type OnErrorBehavior ¶
type OnErrorBehavior string
OnErrorBehavior identifies a response to take when an error is encountered.
const ( OnErrorUnspecified OnErrorBehavior = "" OnErrorStop OnErrorBehavior = "stop" OnErrorContinue OnErrorBehavior = "continue" )
Behavior options when an error is encountered.
type Package ¶
type Package struct {
Name string `json:"name,omitempty"`
Type PackageType `json:"type,omitempty"`
Format PackageFormat `json:"format,omitempty"`
Sources []PackageSource `json:"sources,omitempty"`
Attributes FileAttributes `json:"attributes,omitzero"`
Files PackageFileMap `json:"files,omitzero"`
Commands CommandMap `json:"commands,omitzero"`
}
Package defines a deployment package.
TODO: Add support for a destination directory where an archive's extracted files will be extracted to. If a destination is not provided, then fall back to the current approach that extracts files to a temporary directory.
func (Package) FileExtension ¶
FileExtension returns an appropriate file extension for the package.
If the package type is not recognized, it returns "file".
type PackageContent ¶
PackageContent is a content-addressable identifier for a package.
func (PackageContent) String ¶
func (content PackageContent) String() string
String returns a string representation of the package content in the form pkg-[id]-hash.
type PackageFile ¶
type PackageFile struct {
Path string `json:"path"`
Attributes FileAttributes `json:"attributes,omitzero"`
}
PackageFile describes a set of files that are expected to be present within an archive package.
type PackageFileID ¶
type PackageFileID string
PackageFileID is a unique identifier for a file within a package.
type PackageFileMap ¶
type PackageFileMap map[PackageFileID]PackageFile
PackageFileMap holds a set of package files mapped by their identifiers.
It is used by archive packages to verify the presence of important files within the archive.
type PackageMap ¶
PackageMap holds a set of packages mapped by their identifiers.
type PackageSource ¶
type PackageSource struct {
Type PackageSourceType
URL string
}
PackageSource defines a potential source for retrieval of a package.
func (PackageSource) Validate ¶
func (source PackageSource) Validate() error
Validate returns a non-nil error if the package source is invalid.
type PackageSourceType ¶
type PackageSourceType string
PackageSourceType declares the type of source for a package.
const (
PackageSourceHTTP PackageSourceType = "http"
)
Package source types.
type PackageType ¶
type PackageType string
PackageType declares the type of a package.
func (PackageType) IsArchive ¶
func (t PackageType) IsArchive() bool
IsArchive returns true if the package type is an archive that must be extracted before use.
type ProcessAttributeID ¶
type ProcessAttributeID string
ProcessAttributeID identifies an attribute of a process.
const (
ProcessName ProcessAttributeID = "name"
)
Process Attributes.
type ProcessMatch ¶
type ProcessMatch struct {
Label string `json:"label,omitempty"`
Attribute ProcessAttributeID `json:"attribute,omitempty"`
Type MatchType `json:"type,omitempty"`
Value string `json:"value,omitempty"`
Any []ProcessMatch `json:"any,omitzero"`
All []ProcessMatch `json:"all,omitzero"`
}
ProcessMatch holds information used to identify processes running on a local machine.
type ProcessResource ¶
type ProcessResource struct {
// Description of the process that is identified.
Description string `json:"description,omitempty"`
// Match describes criteria for identification of a running process.
Match ProcessMatch `json:"match,omitzero"`
}
ProcessResource describes a process resource.
type ProcessResourceID ¶
type ProcessResourceID string
ProcessResourceID is a unique identifier for a process resource.
type ProcessResourceMap ¶
type ProcessResourceMap map[ProcessResourceID]ProcessResource
ProcessResourceMap holds a set of process resources mapped by their identifiers.
type ProductCode ¶
type ProductCode = unpackaged.AppID
ProductCode is an application's product code that uniquely identifies it to the operating system.
type RegistryKeyRef ¶
type RegistryKeyRef struct {
Root RegistryRoot
Lineage []RegistryKeyResource
}
RegistryKeyRef is a resolved reference to a registry key on the local system.
func (RegistryKeyRef) Path ¶
func (ref RegistryKeyRef) Path() (string, error)
Path returns the path of the registry key on the local system.
type RegistryKeyResource ¶
type RegistryKeyResource struct {
// Location is a well-known registry root ID, or another key's
// resource ID.
Location RegistryKeyResourceID `json:"location,omitempty"`
// Name is the name of the key within its location.
Name string `json:"name,omitempty"`
// Path is the relative path of the key within its location.
// Both forward slashes and backslashes will be interpreted as path
// separators.
Path string `json:"path,omitempty"`
}
RegistryKeyResource describes a registry key in the Windows registry.
Its name and path fields are mutually exclusive.
type RegistryKeyResourceID ¶
type RegistryKeyResourceID string
RegistryKeyResourceID is a unique identifier for a registry key.
type RegistryKeyResourceMap ¶
type RegistryKeyResourceMap map[RegistryKeyResourceID]RegistryKeyResource
RegistryKeyResourceMap holds a set of registry key resources mapped by their identifiers.
type RegistryKeyResourceSet ¶
type RegistryKeyResourceSet = idset.SetOf[RegistryKeyResourceID]
RegistryKeyResourceSet holds a set of registry key resource IDs.
type RegistryResources ¶
type RegistryResources struct {
Keys RegistryKeyResourceMap `json:"keys,omitempty"`
Values RegistryValueResourceMap `json:"values,omitempty"`
}
RegistryResources describes resources accessed through the Windows registry.
func (RegistryResources) ResolveKey ¶
func (reg RegistryResources) ResolveKey(key RegistryKeyResourceID) (ref RegistryKeyRef, err error)
ResolveKey resolves the requested registry key resource, returning a registry key reference that can be mapped to a location in the Windows registry.
Successfully resolving a registry key resource means that its location in the Windows registry can be determined, but it does not imply that the key exists.
If the registry key cannot be resolved, an error is returned.
func (RegistryResources) ResolveValue ¶
func (reg RegistryResources) ResolveValue(value RegistryValueResourceID) (ref RegistryValueRef, err error)
ResolveValue resolves the requested registry value resource, returning a registry value reference that can be mapped to a location in the Windows registry.
Successfully resolving a registry value resource means that its location in the Windows registry can be determined, but it does not imply that the value exists.
If the registry value cannot be resolved, an error is returned.
type RegistryRoot ¶
type RegistryRoot struct {
// contains filtered or unexported fields
}
RegistryRoot is a root location within the Windows registry.
func GetRegistryRoot ¶
func GetRegistryRoot(id RegistryKeyResourceID) (root RegistryRoot, ok bool)
GetRegistryRoot looks for a well-known registry root with the given resource ID. If one is found, it is returned and ok will be true.
func (RegistryRoot) AbsolutePath ¶
func (root RegistryRoot) AbsolutePath() (path string, err error)
AbsolutePath return the absolute path to the registry root on the local system, including the predefined key.
func (RegistryRoot) ID ¶
func (root RegistryRoot) ID() RegistryKeyResourceID
ID returns the resource ID of the registry root.
func (RegistryRoot) IsZero ¶
func (root RegistryRoot) IsZero() bool
IsZero returns true if the registry root is undefined.
func (RegistryRoot) Key ¶
func (root RegistryRoot) Key() registry.Key
Key returns the predefined key used by the registry root.
func (RegistryRoot) Path ¶
func (root RegistryRoot) Path() (path string)
Path retrieves the relative path to the root from its predefined key.
type RegistryRootMap ¶
type RegistryRootMap map[RegistryKeyResourceID]RegistryRoot
RegistryRootMap holds a set of registry roots mapped by their well-known identifiers.
type RegistryValueRef ¶
type RegistryValueRef struct {
Root RegistryRoot
Lineage []RegistryKeyResource
ID RegistryValueResourceID
Name string
Type lbvalue.Kind
}
RegistryValueRef is a resolved reference to a registry key on the local system.
func (RegistryValueRef) Key ¶
func (ref RegistryValueRef) Key() RegistryKeyRef
Key returns a reference to the values's registry key.
type RegistryValueResource ¶
type RegistryValueResource struct {
// Key is the registry key resource ID of the key to which the value
// belongs, or the well-known resource ID of a registry root.
Key RegistryKeyResourceID `json:"key"`
// Name is the name of the value within its registry key.
Name string `json:"name"`
// Type is the type of data the value holds.
Type lbvalue.Kind `json:"type"`
}
RegistryValueResource describes a value within the Windows registry.
type RegistryValueResourceID ¶
type RegistryValueResourceID string
RegistryValueResourceID is a unique identifier for a registry value.
type RegistryValueResourceMap ¶
type RegistryValueResourceMap map[RegistryValueResourceID]RegistryValueResource
RegistryValueResourceMap holds a set of registry value resources mapped by their identifiers.
type Resources ¶
type Resources struct {
Processes ProcessResourceMap `json:"processes,omitzero"`
Mutexes MutexMap `json:"mutexes,omitzero"`
Locks LockMap `json:"locks,omitzero"`
Registry RegistryResources `json:"registry,omitzero"`
FileSystem FileSystemResources `json:"file-system,omitzero"`
Packages PackageMap `json:"packages,omitzero"`
}
Resources defines the set of resources used by a deployment, both local and remote.