clientutil

package
v0.0.0-...-c7fba9c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package clientutil offers utilities to turn snap.Info and related structs into client structs and to work with the latter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientAppInfoNotes

func ClientAppInfoNotes(app *client.AppInfo) string

func ClientAppInfosFromSnapAppInfos

func ClientAppInfosFromSnapAppInfos(apps []*snap.AppInfo, decorator StatusDecorator) ([]client.AppInfo, error)

ClientAppInfosFromSnapAppInfos returns client.AppInfos derived from the given snap.AppInfos. If an optional StatusDecorator is provided it will be used to add service status information as well, this will be done only if the snap is active and when the app is a service.

func ClientSnapFromSnapInfo

func ClientSnapFromSnapInfo(snapInfo *snap.Info, decorator StatusDecorator) (*client.Snap, error)

ClientSnapFromSnapInfo returns a client.Snap derived from snap.Info. If an optional StatusDecorator is provided it will be used to add service status information.

Types

type StatusDecorator

type StatusDecorator interface {
	DecorateWithStatus(appInfo *client.AppInfo, snapApp *snap.AppInfo) error
}

A StatusDecorator is able to decorate client.AppInfos with service status.

Jump to

Keyboard shortcuts

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