snappy

package
v0.0.0-...-6d4f196 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModelInfo

func GetModelInfo(c SnapdClient) (map[string]interface{}, error)

GetModelInfo returns information about the device.

Types

type ClientAdapter

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

ClientAdapter adapts our expectations to the snapd client API.

func NewClientAdapter

func NewClientAdapter() *ClientAdapter

NewClientAdapter creates a new ClientAdapter for use in snapweb.

func (*ClientAdapter) CreateUser

func (a *ClientAdapter) CreateUser(request *client.CreateUserOptions) (*client.CreateUserResult, error)

CreateUser creates a local user on the system

func (*ClientAdapter) Find

Find returns a list of snaps available for install from the store for this system and that match the query

func (*ClientAdapter) FindOne

func (a *ClientAdapter) FindOne(name string) (*client.Snap, *client.ResultInfo, error)

FindOne returns a list of snaps available for install from the store for this system and that match the query

func (*ClientAdapter) Icon

func (a *ClientAdapter) Icon(name string) (*client.Icon, error)

Icon returns the Icon belonging to an installed snap.

func (*ClientAdapter) Install

func (a *ClientAdapter) Install(name string, options *client.SnapOptions) (string, error)

Install adds the snap with the given name from the given channel (or the system default channel if not).

func (*ClientAdapter) Interfaces

func (a *ClientAdapter) Interfaces() (client.Interfaces, error)

Interfaces returns the list of supported interfaces on the system

func (*ClientAdapter) Known

func (a *ClientAdapter) Known(assertTypeName string, headers map[string]string) ([]asserts.Assertion, error)

Known queries assertions with type assertTypeName and matching assertion headers.

func (*ClientAdapter) List

func (a *ClientAdapter) List(names []string, opts *client.ListOptions) ([]*client.Snap, error)

List returns the list of all snaps installed on the system with names in the given list; if the list is empty, all snaps.

func (*ClientAdapter) Remove

func (a *ClientAdapter) Remove(name string, options *client.SnapOptions) (string, error)

Remove removes the snap with the given name.

func (*ClientAdapter) Sections

func (a *ClientAdapter) Sections() ([]string, error)

Sections returns the list of available sections

func (*ClientAdapter) ServerVersion

func (a *ClientAdapter) ServerVersion() (*client.ServerVersion, error)

ServerVersion returns information about the snapd server.

func (*ClientAdapter) Snap

func (a *ClientAdapter) Snap(name string) (*client.Snap, *client.ResultInfo, error)

Snap returns the most recently published revision of the snap with the provided name.

type SnapdClient

type SnapdClient interface {
	Icon(name string) (*client.Icon, error)
	Snap(name string) (*client.Snap, *client.ResultInfo, error)
	List(names []string, opts *client.ListOptions) ([]*client.Snap, error)
	Sections() ([]string, error)
	Find(opts *client.FindOptions) ([]*client.Snap, *client.ResultInfo, error)
	FindOne(name string) (*client.Snap, *client.ResultInfo, error)
	Install(name string, options *client.SnapOptions) (string, error)
	Remove(name string, options *client.SnapOptions) (string, error)
	ServerVersion() (*client.ServerVersion, error)
	CreateUser(request *client.CreateUserOptions) (*client.CreateUserResult, error)
	Interfaces() (client.Interfaces, error)
	Known(assertTypeName string, headers map[string]string) ([]asserts.Assertion, error)
}

SnapdClient is a client of the snapd REST API

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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