click

package
v0.0.0-...-6789dc4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package click exposes some utilities related to click packages and wraps libclick to check if packages are installed.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAppId = errors.New("invalid application id")
	ErrMissingApp   = errors.New("application not installed")
)

Functions

This section is empty.

Types

type AppId

type AppId struct {
	Package     string
	Application string
	Version     string
	Click       bool
	// contains filtered or unexported fields
}

AppId holds a parsed application id.

func ParseAndVerifyAppId

func ParseAndVerifyAppId(id string, installedChecker InstalledChecker) (*AppId, error)

ParseAndVerifyAppId parses the given app id and checks if the corresponding app is installed, returning the parsed id or ErrInvalidAppId, or the parsed id and ErrMissingApp respectively.

func ParseAppId

func ParseAppId(id string) (*AppId, error)

func (*AppId) Base

func (app *AppId) Base() string

func (*AppId) DesktopId

func (app *AppId) DesktopId() string

func (*AppId) DispatchPackage

func (app *AppId) DispatchPackage() string

func (*AppId) Icon

func (app *AppId) Icon() string

func (*AppId) InPackage

func (app *AppId) InPackage(pkgname string) bool

func (*AppId) MarshalJSON

func (app *AppId) MarshalJSON() ([]byte, error)

func (*AppId) Original

func (app *AppId) Original() string

func (*AppId) String

func (app *AppId) String() string

func (*AppId) SymbolicIcon

func (app *AppId) SymbolicIcon() string

func (*AppId) UnmarshalJSON

func (app *AppId) UnmarshalJSON(s []byte) error

func (*AppId) Versioned

func (app *AppId) Versioned() string

type ClickUser

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

ClickUser exposes the click package registry for the user.

func User

func User() (*ClickUser, error)

User makes a new ClickUser object for the current user.

func (*ClickUser) Installed

func (cu *ClickUser) Installed(app *AppId, setVersion bool) bool

Installed checks if the appId is installed for user, optionally setting the version if it was absent.

type InstalledChecker

type InstalledChecker interface {
	Installed(app *AppId, setVersion bool) bool
}

Directories

Path Synopsis
Package cclick has the internal cgo wrapping libclick for package click.
Package cclick has the internal cgo wrapping libclick for package click.
Package testing contains helpers for testing related to click.
Package testing contains helpers for testing related to click.

Jump to

Keyboard shortcuts

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