Documentation
¶
Index ¶
- Variables
- func FetchAndCheckSnapAssertions(snapPath string, info *snap.Info, f asserts.Fetcher, db asserts.RODatabase) (*asserts.SnapDeclaration, error)
- func MockTrusted(mockTrusted []asserts.Assertion) (restore func())
- func Prepare(opts *Options) error
- type DownloadOptions
- type Options
- type Store
- type ToolingStore
- func (tsto *ToolingStore) AssertionFetcher(db *asserts.Database, save func(asserts.Assertion) error) asserts.Fetcher
- func (tsto *ToolingStore) DownloadSnap(name string, opts DownloadOptions) (targetFn string, info *snap.Info, err error)
- func (tsto *ToolingStore) Find(at *asserts.AssertionType, headers map[string]string) (asserts.Assertion, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FetchAndCheckSnapAssertions ¶
func FetchAndCheckSnapAssertions(snapPath string, info *snap.Info, f asserts.Fetcher, db asserts.RODatabase) (*asserts.SnapDeclaration, error)
FetchAndCheckSnapAssertions fetches and cross checks the snap assertions matching the given snap file using the provided asserts.Fetcher and assertion database.
func MockTrusted ¶
Types ¶
type DownloadOptions ¶
type DownloadOptions struct { Revision snap.Revision TargetDir string Channel string CohortKey string Basename string LeavePartialOnError bool }
DownloadOptions carries options for downloading snaps plus assertions.
func (*DownloadOptions) String ¶
func (opts *DownloadOptions) String() string
type Options ¶
type Options struct { Classic bool Snaps []string RootDir string Channel string SnapChannels map[string]string ModelFile string GadgetUnpackDir string // Architecture to use if none is specified by the model, // useful only for classic mode. If set must match the model otherwise. Architecture string }
type Store ¶
type Store interface { SnapAction(context.Context, []*store.CurrentSnap, []*store.SnapAction, *auth.UserState, *store.RefreshOptions) ([]*snap.Info, error) Download(ctx context.Context, name, targetFn string, downloadInfo *snap.DownloadInfo, pbar progress.Meter, user *auth.UserState, dlOpts *store.DownloadOptions) error Assertion(assertType *asserts.AssertionType, primaryKey []string, user *auth.UserState) (asserts.Assertion, error) }
A Store can find metadata on snaps, download snaps and fetch assertions.
type ToolingStore ¶
type ToolingStore struct {
// contains filtered or unexported fields
}
ToolingStore wraps access to the store for tools.
func NewToolingStore ¶
func NewToolingStore() (*ToolingStore, error)
func NewToolingStoreFromModel ¶
func NewToolingStoreFromModel(model *asserts.Model, fallbackArchitecture string) (*ToolingStore, error)
func (*ToolingStore) AssertionFetcher ¶
func (tsto *ToolingStore) AssertionFetcher(db *asserts.Database, save func(asserts.Assertion) error) asserts.Fetcher
AssertionFetcher creates an asserts.Fetcher for assertions against the given store using dlOpts for authorization, the fetcher will add assertions in the given database and after that also call save for each of them.
func (*ToolingStore) DownloadSnap ¶
func (tsto *ToolingStore) DownloadSnap(name string, opts DownloadOptions) (targetFn string, info *snap.Info, err error)
DownloadSnap downloads the snap with the given name and optionally revision using the provided store and options. It returns the final full path of the snap inside the opts.TargetDir and a snap.Info for the snap.
func (*ToolingStore) Find ¶
func (tsto *ToolingStore) Find(at *asserts.AssertionType, headers map[string]string) (asserts.Assertion, error)
Find provides the snapsserts.Finder interface for snapasserts.DerviceSideInfo