dpkg

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const QueryFormat = `` /* 188-byte string literal not displayed */

QueryFormat is used when querying the dpkg database

Variables

This section is empty.

Functions

func Supported

func Supported() bool

Supported returns true if the current system supports dpkg

Types

type DpkgSource

type DpkgSource struct{}

DpkgSource struct on which all methods are registered

func (*DpkgSource) Contexts

func (s *DpkgSource) Contexts() []string

List of contexts that this source is capable of find items for

func (*DpkgSource) Find

func (s *DpkgSource) Find(ctx context.Context, itemContext string) ([]*sdp.Item, error)

Find Gets information about all item that the source can possibly find. If nothing is found then just return an empty list (Required)

func (*DpkgSource) Get

func (s *DpkgSource) Get(ctx context.Context, itemContext string, query string) (*sdp.Item, error)

Get takes the UniqueAttribute value as a parameter (also referred to as the "name" of the item) and returns a full item will all details. This function must return an item whose UniqueAttribute value exactly matches the supplied parameter. If the item cannot be found it should return an ItemNotFoundError (Required)

func (*DpkgSource) Name

func (s *DpkgSource) Name() string

Descriptive name for the source, used in logging and metadata

func (*DpkgSource) Search

func (s *DpkgSource) Search(ctx context.Context, itemContext string, query string) ([]*sdp.Item, error)

Search takes a file name or binary name and runs this through rpm -q --whatprovides

func (*DpkgSource) Supported

func (s *DpkgSource) Supported() bool

func (*DpkgSource) Type

func (s *DpkgSource) Type() string

Type is the type of items that this returns (Required)

func (*DpkgSource) Weight

func (s *DpkgSource) Weight() int

Weighting of duplicate sources

type NotFoundError

type NotFoundError struct {
	Message string
}

NotFoundError will be returned when the dpkg wasn't installed

func (NotFoundError) Error

func (m NotFoundError) Error() string

type Package

type Package struct {
	Name          string
	Status        string
	Priority      string
	Section       string
	InstalledSize int
	Maintainer    string
	Architecture  string
	Version       string
	Homepage      *url.URL
	Summary       string
	Description   string
}

Package represents information about an dpkg package

func Search(ctx context.Context, pattern string) ([]Package, error)

Search searches for what packages provides a given file or filename-search-pattern

func Show

func Show(ctx context.Context, name string) (Package, error)

Show Gets info for one specific package

func ShowAll

func ShowAll(ctx context.Context) ([]Package, error)

ShowAll shows all packages

Jump to

Keyboard shortcuts

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