snap

package
v0.0.0-...-921daf7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFormat

func RegisterFormat(magic []byte, open func(fn string) (File, error))

RegisterFormat registers a snap file format to the system

func ValidateName

func ValidateName(name string) error

ValidateName checks if a string can be used as a snap name.

Types

type File

type File interface {
	Install(targetDir string) error

	// MetaMember returns data from a meta/ directory file member
	MetaMember(name string) ([]byte, error)

	//Unpack unpacks the src parts to the dst directory
	Unpack(src, dst string) error

	// Info returns information about the given snap file
	Info() (*Info, error)
}

File is the interface to interact with the low-level snap files

func Open

func Open(path string) (File, error)

Open opens a given snap file with the right backend

type Info

type Info struct {
	Name    string
	Version string
	Type    Type
}

Info provides information about packages

func InfoFromSnapYaml

func InfoFromSnapYaml(yamlData []byte) (*Info, error)

InfoFromSnapYaml creates a new info based on the given snap.yaml data

type Type

type Type string

Type represents the kind of snap (app, core, frameworks, gadget)

const (
	TypeApp       Type = "app"
	TypeCore      Type = "core"
	TypeFramework Type = "framework"
	TypeGadget    Type = "gadget"
	TypeOS        Type = "os"
	TypeKernel    Type = "kernel"
)

The various types of snap parts we support

func (Type) MarshalJSON

func (m Type) MarshalJSON() ([]byte, error)

MarshalJSON returns *m as the JSON encoding of m.

func (*Type) UnmarshalJSON

func (m *Type) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

Directories

Path Synopsis
Package lightweight provides a quick way of loading things that can become snaps.
Package lightweight provides a quick way of loading things that can become snaps.
Package removed implements Removed packages, that are packages that have been installed, removed, but not purged: there is no application, but there might be data.
Package removed implements Removed packages, that are packages that have been installed, removed, but not purged: there is no application, but there might be data.

Jump to

Keyboard shortcuts

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