backend

package
v2.42.5-go-mod+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package backend implements the low-level primitives to manage the snaps and their installation on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenSnapFile

func OpenSnapFile(snapPath string, sideInfo *snap.SideInfo) (*snap.Info, snap.Container, error)

OpenSnapFile opens a snap blob returning both a snap.Info completed with sideInfo (if not nil) and a corresponding snap.Container. Assumes the file was verified beforehand or the user asked for --dangerous.

Types

type Alias

type Alias struct {
	Name   string `json:"name"`
	Target string `json:"target"`
}

Alias represents a command alias with a name and its application target.

type Backend

type Backend struct{}

Backend exposes all the low-level primitives to manage snaps and their installation on disk.

func (Backend) Candidate

func (b Backend) Candidate(*snap.SideInfo)

Candidate is a test hook.

func (Backend) ClearTrashedData

func (b Backend) ClearTrashedData(oldSnap *snap.Info)

ClearTrashedData removes the trash. It returns no errors on the assumption that it is called very late in the game.

func (Backend) CopySnapData

func (b Backend) CopySnapData(newSnap, oldSnap *snap.Info, meter progress.Meter) error

CopySnapData makes a copy of oldSnap data for newSnap in its data directories.

func (Backend) CurrentInfo

func (b Backend) CurrentInfo(*snap.Info)

CurrentInfo is a test hook.

func (Backend) DiscardSnapNamespace

func (b Backend) DiscardSnapNamespace(snapName string) error

Discard the mount namespace of a given snap.

func (Backend) LinkSnap

func (b Backend) LinkSnap(info *snap.Info, model *asserts.Model, tm timings.Measurer) (e error)

LinkSnap makes the snap available by generating wrappers and setting the current symlinks.

func (Backend) RemoveSnapAliases

func (b Backend) RemoveSnapAliases(snapName string) error

RemoveSnapAliases removes all the aliases targeting the given snap.

func (Backend) RemoveSnapCommonData

func (b Backend) RemoveSnapCommonData(snap *snap.Info) error

RemoveSnapCommonData removes the data common between versions of the given snap.

func (Backend) RemoveSnapData

func (b Backend) RemoveSnapData(snap *snap.Info) error

RemoveSnapData removes the data for the given version of the given snap.

func (Backend) RemoveSnapDataDir

func (b Backend) RemoveSnapDataDir(info *snap.Info, hasOtherInstances bool) error

RemoveSnapDataDir removes base snap data directory

func (Backend) RemoveSnapDir

func (b Backend) RemoveSnapDir(s snap.PlaceInfo, hasOtherInstances bool) error

func (Backend) RemoveSnapFiles

func (b Backend) RemoveSnapFiles(s snap.PlaceInfo, typ snap.Type, meter progress.Meter) error

RemoveSnapFiles removes the snap files from the disk after unmounting the snap.

func (Backend) SetupSnap

func (b Backend) SetupSnap(snapFilePath, instanceName string, sideInfo *snap.SideInfo, meter progress.Meter) (snapType snap.Type, err error)

SetupSnap does prepare and mount the snap for further processing.

func (Backend) StartServices

func (b Backend) StartServices(apps []*snap.AppInfo, meter progress.Meter, tm timings.Measurer) error

func (Backend) StopServices

func (b Backend) StopServices(apps []*snap.AppInfo, reason snap.ServiceStopReason, meter progress.Meter, tm timings.Measurer) error

func (Backend) UndoCopySnapData

func (b Backend) UndoCopySnapData(newInfo *snap.Info, oldInfo *snap.Info, meter progress.Meter) error

UndoCopySnapData removes the copy that may have been done for newInfo snap of oldInfo snap data and also the data directories that may have been created for newInfo snap.

func (Backend) UndoSetupSnap

func (b Backend) UndoSetupSnap(s snap.PlaceInfo, typ snap.Type, meter progress.Meter) error

UndoSetupSnap undoes the work of SetupSnap using RemoveSnapFiles.

func (Backend) UnlinkSnap

func (b Backend) UnlinkSnap(info *snap.Info, meter progress.Meter) error

UnlinkSnap makes the snap unavailable to the system removing wrappers and symlinks.

func (Backend) UpdateAliases

func (b Backend) UpdateAliases(add []*Alias, remove []*Alias) error

UpdateAliases adds and removes the given aliases.

Jump to

Keyboard shortcuts

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