apt

package module
v0.0.0-...-f2b07ae Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package goapt provides go bindings for the APT package management tool.

The bindings allow exploring the APT cache and configuration. They use cgo with a middle layer of C bindings to the underlying C++ code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache represents an APT cache file. An APT cache contains information about available and installed packages, the versions, and to some extend, also configured repositories.

func (*Cache) GetPackage

func (c *Cache) GetPackage(id int) *Package

GetPackage gets the package with the specified ID.

func (*Cache) Lookup

func (c *Cache) Lookup(Pkg string) *Package

Lookup a package without an extra architecture argument.

func (*Cache) LookupWithArch

func (c *Cache) LookupWithArch(Pkg string, Arch string) *Package

LookupWithArch looks a package up by its name in the cache.

func (*Cache) PackageCount

func (c *Cache) PackageCount() int

PackageCount Return the number of packages in the cache.

type Config

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

func (*Config) Find

func (cfg *Config) Find(key string) string

type DepCache

type DepCache struct{}

DepCache is a collection of marked package states

type Package

type Package struct{}

Package is a combination of a name and an architecture.

type Policy

type Policy struct{}

Policy determines the priority of versions of a package.

func (*Policy) CandidateVersion

func (p *Policy) CandidateVersion(Pkg *Package) *Version

CandidateVersion returns the candidate version of a package.

func (*Policy) Priority

func (p *Policy) Priority(Ver *Version) int

Priority returns the priority of the given version.

type Session

type Session struct{}

Session represents the C++ type pkgCacheFile, a cache with a depcache, a policy, and so on.

func NewSession

func NewSession() (*Session, error)

NewSession opens a new session. Note that Config() and System() really are global variables. They will be initialized here, but there can only really be one session at one time.

func NewSessionWithConfig

func NewSessionWithConfig(cfg *Config) (*Session, error)

NewSessionWithConfig opens a new session, with the specified configuration set as the global configuration object instead of the default one.

func (*Session) Cache

func (s *Session) Cache() (*Cache, error)

func (*Session) Config

func (s *Session) Config() (*Config, error)

Config gets the configuration object associated with the session. This is currently a global variable in apt.

func (*Session) DepCache

func (s *Session) DepCache() (*DepCache, error)

func (*Session) Policy

func (s *Session) Policy() (*Policy, error)

func (*Session) System

func (s *Session) System() (*System, error)

type System

type System struct{}

System is a system-level package manager, like dpkg

type Version

type Version struct{}

Version represents a single version of a package (like a .deb file)

func (*Version) VerStr

func (v *Version) VerStr() string

VerStr returns the version as a string.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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