package
0.0.0-20250312152250-ea85ec9d2454
Repository: https://github.com/snapcore/snapd.git
Documentation: pkg.go.dev
# Packages
Package clientutil offers utilities to turn snap.Info and related structs into client structs and to work with the latter.
# Functions
InternalSnapctlCmdNeedsStdin returns true if the given snapctl command needs data from stdin.
IsAssertionNotFoundError returns whether the given error means that the assertion wasn't found and thus the device isn't ready/seeded.
IsInterfacesUnchangedError returns whether the given error means the requested change to interfaces was not made, because there was nothing to do.
IsRetryable returns true if the given error is an error that can be retried later.
IsTwoFactorError returns whether the given error is due to problems in two-factor authentication.
MockDoTimings mocks the delay used by the do retry loop and request timeout.
New returns a new instance of Client.
# Constants
AllowInteractionHeader is the HTTP request header used to indicate that the client is willing to allow interaction.
No description provided by the author
No description provided by the author
No description provided by the author
Statuses and types a snap may have.
Statuses and types a snap may have.
ErrorKindAppArmorPromptingNotRunning: AppArmor Prompting is not running.
ErrorKindAppNotFound: the requested app couldn't be found.
ErrorKindAssertionNotFound: assertion can not be found.
ErrorKindAuthCancelled: authentication was cancelled by the user.
ErrorKindBadQuery: a bad query was provided.
ErrorKindConfigNoSuchOption: the given configuration option does not exist.
ErrorKindDaemonRestart: daemon is restarting.
ErrorKindDNSFailure: DNS not responding.
ErrorKindInsufficientDiskSpace: not enough disk space to perform the request.
ErrorKindInterfacesRequestsInvalidFields: POST body to prompting API contains invalid fields.
ErrorKindInterfacesRequestsPatchedRuleHasNoPermissions: patched rule has no permission.
ErrorKindInterfacesRequestsPromptNotFound: interfaces requests prompt not found.
ErrorKindInterfacesRequestsReplyNotMatchRequest: the prompt reply does not match the path and/or permissions which were requested.
ErrorKindInterfacesRequestsRuleConflict: a rule with conflicting path pattern and permissions already exists.
ErrorKindInterfacesRequestsRuleNotFound: interfaces requests rule not found.
ErrorKindInterfacesUnchanged: the requested interfaces' operation would have no effect.
ErrorKindInvalidAuthData: the authentication data provided failed to validate (e.g.
ErrorKindInvalidPassphrase: passphrase is invalid and/or does not pass quality checks.
ErrorKindInvalidPIN: PIN is invalid and/or does not pass quality checks.
ErrorKindLoginRequired: the requested operation cannot be performed without an authenticated user.
ErrorKindMissingSnapResourcePair: cannot find a snap-resource-pair when attempting to sideload a component.
ErrorKindNetworkTimeout: a timeout occurred during the request.
ErrorKindNoPaymentMethods: deprecated, do not document.
ErrorKindNotSnap: the given snap or directory does not look like a snap.
ErrorKindPasswordPolicy: provided password doesn't meet system policy.
ErrorKindPaymentDeclined: deprecated, do not document.
ErrorKindQuotaChangeConflict: the requested operation would conflict with a currently ongoing change affecting the quota group.
ErrorKindSnapAlreadyInstalled: the requested snap is already installed.
ErrorKindSnapArchitectureNotAvailable: no snap revision on specified architecture.
ErrorKindSnapChangeConflict: the requested operation would conflict with currently ongoing change.
ErrorKindSnapChannelNotAvailable: no snap revision on specified channel.
ErrorKindSnapLocal: cannot perform operation on local snap.
ErrorKindSnapNeedsClassic: the requested snap needs classic confinement to be installed.
ErrorKindSnapNeedsClassicSystem: the requested snap can't be installed on the current non-classic system.
ErrorKindSnapNeedsDevMode: the requested snap needs devmode to be installed.
ErrorKindSnapNotClassic: snap not compatible with classic mode.
ErrorKindSnapNotFound: the requested snap couldn't be found.
ErrorKindSnapNotInstalled: the requested snap is not installed.
ErrorKindSnapNoUpdateAvailable: the requested snap does not have an update available.
ErrorKindSnapRevisionNotAvailable: no snap revision available as specified.
ErrorKindSystemRestart: system is restarting.
ErrorKindTermsNotAccepted: deprecated, do not document.
ErrorKindTwoFactorFailed: the OTP provided wasn't recognised.
ErrorKindTwoFactorRequired: the client needs to retry the `login` command including an OTP.
ErrorKindUnsuccessful: snapctl command was unsuccessful.
ErrorKindUnsupported: target system does not support corresponding feature (e.g.
ErrorKindValidationSetNotFound: validation set cannot be found.
Creates a change to finish the installation.
Creates a change to setup encryption for the partitions with system-{data,save} roles.
SnapRunInhibitNotice is recorded when "snap run" is inhibited due refresh.
SnapshotExportMediaType is the media type used to identify snapshot exports in the API.
Statuses and types a snap may have.
Statuses and types a snap may have.
Statuses and types a snap may have.
Statuses and types a snap may have.
Statuses and types a snap may have.
Indicates that passphrase authentication is available.
Indicates that PIN authentication is available.
encryption available and usable.
encryption unavailable and required, this is an error.
forcefull disabled by the device.
encryption unavailable but not required.
Statuses and types a snap may have.
No description provided by the author
No description provided by the author
Statuses and types a snap may have.
Statuses and types a snap may have.
Statuses and types a snap may have.
Statuses and types a snap may have.
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
ErrNoNames is returned by Start, Stop, or Restart, when the given list of things on which to operate is empty.
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
AliasStatus represents the status of an alias.
AppActivator is a thing that activates the app that is a service in the system.
AppInfo describes a single snap application.
AppOptions represent the options of the Apps call.
No description provided by the author
AvailableForInstall contains information about snaps and components that are optional in the system's model, but are available for installation.
BuyOptions specifies parameters to buy from the store.
BuyResult holds the state of a buy attempt.
Information about a category.
A Change is a modification to the system state.
No description provided by the author
A Client knows how to talk to the snappy daemon.
No description provided by the author
Component describes a component for API purposes TODO we will eventually add a "status" field when it becomes clear which states can a component have.
Config allows to customize client behavior.
Connection describes a connection between a plug and a slot.
No description provided by the author
ConnectionOptions contains criteria for selecting matching connections, plugs and slots.
Connections contains information about connections, as well as related plugs and slots.
CreateSystemOptions contains the options for creating a new recovery system.
CreateUserOptions holds options for creating a local system user.
CreateUserResult holds the result of a user creation.
DisconnectOptions represents extra options for disconnect op.
No description provided by the author
No description provided by the author
No description provided by the author
Error is the real value of response.Result when an error occurs.
FindOptions supports exactly one of the following options: - Refresh: only return snaps that are refreshable - Private: return snaps that are private - Query: only return snaps that match the query string.
Icon represents the icon of an installed snap.
No description provided by the author
Interface holds information about a given interface and its instances.
InterfaceAction represents an action performed on the interface system.
InterfaceOptions represents opt-in elements include in responses.
No description provided by the author
InternalConsoleConfStartResponse is the response from console-conf start support.
KnownOptions represent the options of the Known call.
No description provided by the author
A Log holds the information of a single syslog entry.
LogOptions represent the options of the Logs call.
No description provided by the author
No description provided by the author
OSRelease contains information about the system extracted from /etc/os-release.
Plug represents the potential of a given snap to connect to a slot.
PlugRef is a reference to a plug.
QualityCheckOptions contains the passphrase or PIN whose quality should be checked.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RefreshInfo contains information about refreshes.
RemodelOpts defines options to be used when remodeling the system.
RemoveUserOptions holds options for removing a local system user.
No description provided by the author
RestartOptions represent the different options of the Restart call.
No description provided by the author
No description provided by the author
Slot represents a capacity offered by a snap.
SlotRef is a reference to a slot.
Snap holds the data for a snap as obtained from snapd.
SnapCtlOptions holds the various options with which snapctl is invoked.
SnapCtlPostData is the data posted to the daemon /v2/snapctl endpoint TODO: this can be removed again once we no longer need to pass stdin data but instead use a real stdin stream.
No description provided by the author
No description provided by the author
No description provided by the author
A Snapshot is a collection of archives with a simple metadata json file (and hashsums of everything).
SnapshotImportSet is a snapshot import created by a "snap import-snapshot".
A SnapshotSet is a set of snapshots created by a single "snap save".
StartOptions represent the different options of the Start call.
StopOptions represent the different options of the Stop call.
No description provided by the author
SysInfo holds system information.
No description provided by the author
No description provided by the author
No description provided by the author
SystemModelData contains information about the model.
No description provided by the author
A Task is an operation done to change the system's state.
No description provided by the author
User holds logged in user information.
UserSelector is a support structure for correctly translating a way of representing both a list of user-names, and specific keywords like "self" and "all" for JSON marshalling.
ValidateApplyOptions carries options for ApplyValidationSet.
ValidationSetResult holds information about a single validation set.
A Warning is a short messages that's meant to alert about system events.
WarningsOptions contains options for querying snapd for warnings supported options: - All: return all warnings, instead of only the un-okayed ones.
# Type aliases
No description provided by the author
ErrorKind distinguishes kind of errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TransactionType says whether we want to treat each snap separately (the transaction is per snap) or whether to consider the call a single transaction so everything is reverted if it fails for just one snap.
No description provided by the author