Documentation ¶
Index ¶
- Constants
- Variables
- type CfgFilesFile
- type Checksum
- type ControlFile
- func (cf *ControlFile) Architecture() string
- func (cf *ControlFile) Breaks() []string
- func (cf *ControlFile) Conflicts() []string
- func (cf *ControlFile) Depends() []string
- func (cf *ControlFile) Description() []string
- func (cf *ControlFile) Enhances() []string
- func (cf *ControlFile) Homepage() string
- func (cf *ControlFile) InstalledSize() int
- func (cf *ControlFile) Licence() string
- func (cf *ControlFile) Maintainer() string
- func (cf *ControlFile) MultiArch() string
- func (cf *ControlFile) OE() string
- func (cf *ControlFile) OriginalMaintainer() string
- func (cf *ControlFile) Package() string
- func (cf *ControlFile) Predepends() []string
- func (cf *ControlFile) Priority() string
- func (cf *ControlFile) Provides() []string
- func (cf *ControlFile) Recommends() []string
- func (cf *ControlFile) Replaces() []string
- func (cf *ControlFile) Section() string
- func (cf *ControlFile) Source() string
- func (cf *ControlFile) Suggests() []string
- func (cf *ControlFile) Summary() string
- func (cf *ControlFile) Version() string
- type FileInfo
- func (f *FileInfo) Digest() string
- func (f *FileInfo) Group() string
- func (f *FileInfo) IsDir() bool
- func (f *FileInfo) Linkname() string
- func (f *FileInfo) ModTime() time.Time
- func (f *FileInfo) Mode() os.FileMode
- func (f *FileInfo) Name() string
- func (f *FileInfo) Owner() string
- func (f *FileInfo) Size() int64
- func (f *FileInfo) String() string
- func (f *FileInfo) Sys() interface{}
- type PackageFile
- func (c *PackageFile) ConffilesFile() *CfgFilesFile
- func (c *PackageFile) ControlFile() *ControlFile
- func (c *PackageFile) DebVersion() string
- func (c *PackageFile) FileSize() uint64
- func (c *PackageFile) FileTime() time.Time
- func (c *PackageFile) Files() []FileInfo
- func (c *PackageFile) GetCalculatedChecksum(path string) string
- func (c *PackageFile) GetFileChecksum(path string) string
- func (c *PackageFile) GetFileMd5Sums(path string) string
- func (c *PackageFile) GetPackageChecksum() *Checksum
- func (c *PackageFile) Path() string
- func (c *PackageFile) PostInstallScript() string
- func (c *PackageFile) PostUninstallScript() string
- func (c *PackageFile) PreInstallScript() string
- func (c *PackageFile) PreUninstallScript() string
- func (c *PackageFile) SetCalculatedChecksum(path, sum string) *PackageFile
- func (c *PackageFile) SharedLibsFile() *SharedLibsFile
- func (c *PackageFile) SymbolsFile() *SymbolsFile
- func (c *PackageFile) TriggersFile() *TriggerFile
- type PackageFileReader
- type PackageOptions
- type SharedLibrary
- type SharedLibsFile
- type SymbolElement
- type SymbolsFile
- type Trigger
- type TriggerFile
Constants ¶
const ( HASH_MD5 = iota HASH_SHA1 HASH_SHA256 )
Variables ¶
var DefaultPackageOptions = &PackageOptions{ MetaOnly: false, Hash: HASH_MD5, RecalculateChecksums: true, }
Functions ¶
This section is empty.
Types ¶
type CfgFilesFile ¶
type CfgFilesFile struct {
// contains filtered or unexported fields
}
func NewCfgFilesFiles ¶
func NewCfgFilesFiles() *CfgFilesFile
func (*CfgFilesFile) Names ¶
func (cfg *CfgFilesFile) Names() []string
type Checksum ¶
type Checksum struct {
// contains filtered or unexported fields
}
Checksum object computes and returns the SHA256, SHA1 and MD5 checksums encoded in hexadecimal) of the package file.
Checksum reopens the package using the file path that was given via OpenPackageFile.
func NewBytesChecksum ¶
type ControlFile ¶
type ControlFile struct {
// contains filtered or unexported fields
}
Control file
func NewControlFile ¶
func NewControlFile() *ControlFile
func (*ControlFile) Architecture ¶
func (cf *ControlFile) Architecture() string
func (*ControlFile) Breaks ¶
func (cf *ControlFile) Breaks() []string
func (*ControlFile) Conflicts ¶
func (cf *ControlFile) Conflicts() []string
func (*ControlFile) Depends ¶
func (cf *ControlFile) Depends() []string
func (*ControlFile) Description ¶
func (cf *ControlFile) Description() []string
func (*ControlFile) Enhances ¶
func (cf *ControlFile) Enhances() []string
func (*ControlFile) Homepage ¶
func (cf *ControlFile) Homepage() string
func (*ControlFile) InstalledSize ¶
func (cf *ControlFile) InstalledSize() int
func (*ControlFile) Maintainer ¶
func (cf *ControlFile) Maintainer() string
func (*ControlFile) MultiArch ¶
func (cf *ControlFile) MultiArch() string
func (*ControlFile) OE ¶
func (cf *ControlFile) OE() string
func (*ControlFile) OriginalMaintainer ¶
func (cf *ControlFile) OriginalMaintainer() string
func (*ControlFile) Package ¶
func (cf *ControlFile) Package() string
func (*ControlFile) Predepends ¶
func (cf *ControlFile) Predepends() []string
func (*ControlFile) Priority ¶
func (cf *ControlFile) Priority() string
func (*ControlFile) Provides ¶
func (cf *ControlFile) Provides() []string
func (*ControlFile) Recommends ¶
func (cf *ControlFile) Recommends() []string
func (*ControlFile) Replaces ¶
func (cf *ControlFile) Replaces() []string
func (*ControlFile) Section ¶
func (cf *ControlFile) Section() string
func (*ControlFile) Suggests ¶
func (cf *ControlFile) Suggests() []string
func (*ControlFile) Summary ¶
func (cf *ControlFile) Summary() string
Summary returns a first line of Description
func (*ControlFile) Version ¶
func (cf *ControlFile) Version() string
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
A FileInfo describes a file in a Deb package and is returned by packagefile.Files.
FileInfo implements the os.FileInfo interface.
type PackageFile ¶
type PackageFile struct {
// contains filtered or unexported fields
}
PackageFile object
func OpenPackageFile ¶
func OpenPackageFile(uri string, opts *PackageOptions) (*PackageFile, error)
OpenPackageFile from URI string.
func (*PackageFile) ConffilesFile ¶
func (c *PackageFile) ConffilesFile() *CfgFilesFile
ConffilesFile returns parsed triggers file data.
func (*PackageFile) ControlFile ¶
func (c *PackageFile) ControlFile() *ControlFile
ControlFile returns parsed data of the package's control file
func (*PackageFile) DebVersion ¶
func (c *PackageFile) DebVersion() string
DpkgVersion returns the version of the format of the .deb file
func (*PackageFile) FileSize ¶
func (c *PackageFile) FileSize() uint64
FileSize returns the size of the package file in bytes if it was opened with OpenPackageFile.
func (*PackageFile) FileTime ¶
func (c *PackageFile) FileTime() time.Time
FileTime returns the time at which the Debian package file was last modified if it was opened with OpenPackageFile.
func (*PackageFile) Files ¶
func (c *PackageFile) Files() []FileInfo
Return meta-content of the package
func (*PackageFile) GetCalculatedChecksum ¶
func (c *PackageFile) GetCalculatedChecksum(path string) string
func (*PackageFile) GetFileChecksum ¶
func (c *PackageFile) GetFileChecksum(path string) string
GetFileChecksum returns file checksum by relative path
func (*PackageFile) GetFileMd5Sums ¶
func (c *PackageFile) GetFileMd5Sums(path string) string
GetFileMd5Sums returns file checksum by relative path from the md5sums file. NOTE: md5sums file omits configuration files.
func (*PackageFile) GetPackageChecksum ¶
func (c *PackageFile) GetPackageChecksum() *Checksum
GetPackageChecksum returns checksum of the package itself
func (*PackageFile) Path ¶
func (c *PackageFile) Path() string
Path returns the path which was given to open a package file if it was opened with OpenPackageFile.
func (*PackageFile) PostInstallScript ¶
func (c *PackageFile) PostInstallScript() string
func (*PackageFile) PostUninstallScript ¶
func (c *PackageFile) PostUninstallScript() string
func (*PackageFile) PreInstallScript ¶
func (c *PackageFile) PreInstallScript() string
func (*PackageFile) PreUninstallScript ¶
func (c *PackageFile) PreUninstallScript() string
func (*PackageFile) SetCalculatedChecksum ¶
func (c *PackageFile) SetCalculatedChecksum(path, sum string) *PackageFile
SetCalculatedChecksum sets pre-calculated checksum out of the package directly. Dpkg has only md5sums and often these are neglected or incorrect (e.g. no configuration files). Sometimes md5sums is not even shipped (rare cases). In this case there is no way to get all the information out of a .deb package into a some sort of database and then later on find out if a particular file has been changed on the disk.
func (*PackageFile) SharedLibsFile ¶
func (c *PackageFile) SharedLibsFile() *SharedLibsFile
SharedLibsFile returns parsed shlibs file data (an alternative system to symbols)
func (*PackageFile) SymbolsFile ¶
func (c *PackageFile) SymbolsFile() *SymbolsFile
SymbolsFile returns parsed symbols file data
func (*PackageFile) TriggersFile ¶
func (c *PackageFile) TriggersFile() *TriggerFile
TriggersFile returns parsed triggers file data.
type PackageFileReader ¶
type PackageFileReader struct {
// contains filtered or unexported fields
}
PackageFileReader object
func NewPackageFileReader ¶
func NewPackageFileReader(reader io.Reader) *PackageFileReader
PackageFileReader constructor
func (*PackageFileReader) Read ¶
func (pfr *PackageFileReader) Read() (*PackageFile, error)
Read Debian package data from the stream
func (*PackageFileReader) SetHash ¶
func (pfr *PackageFileReader) SetHash(hash int) *PackageFileReader
SetHash of the pre-calculated checksum
func (*PackageFileReader) SetMetaonly ¶
func (pfr *PackageFileReader) SetMetaonly(metaonly bool) *PackageFileReader
type PackageOptions ¶
type PackageOptions struct { // Do not process actual files in "data" archive, only read the headers. // This is useful for quick scans. MetaOnly bool // Set a hash type, one of HASH_MD5, HASH_SHA1 or HASH_SHA256. // Default is HASH_MD5 Hash int // Recalculate checksums, because dpkg is quite lousy here. // Usually it is a very good idea to do so, but not needed if the package // information is not intended to be used for system verification. RecalculateChecksums bool }
type SharedLibrary ¶
type SharedLibrary struct {
// contains filtered or unexported fields
}
func NewSharedLibrary ¶
func NewSharedLibrary() *SharedLibrary
func (*SharedLibrary) Dependencies ¶
func (shl *SharedLibrary) Dependencies() []string
Dependencies returns the list of dependencies of the shared library.
func (*SharedLibrary) Name ¶
func (shl *SharedLibrary) Name() string
Name returns the name of the shared library.
func (*SharedLibrary) Tag ¶
func (shl *SharedLibrary) Tag() string
Tag returns possible shared library tag. Usually it is an empty string.
func (*SharedLibrary) Version ¶
func (shl *SharedLibrary) Version() string
Version returns the version of the shared library.
type SharedLibsFile ¶
type SharedLibsFile struct {
// contains filtered or unexported fields
}
func NewSharedLibsFile ¶
func NewSharedLibsFile() *SharedLibsFile
func (*SharedLibsFile) Libraries ¶
func (shl *SharedLibsFile) Libraries() []SharedLibrary
Libraries returns shared libraries
type SymbolElement ¶
type SymbolElement struct {
// contains filtered or unexported fields
}
Basic symbol description. It is not parsed "to the ground" at the moment. It has only a symbol itself and the version of it.
func (*SymbolElement) Base ¶
func (se *SymbolElement) Base() string
Returns the entire symbol in one row This does not parses (yet?) things like: (arch-bits=32|arch-endian=little)32bit_le_symbol@Base etc.
func (*SymbolElement) Version ¶
func (se *SymbolElement) Version() string
Returns version of the symbol
type SymbolsFile ¶
type SymbolsFile struct {
// contains filtered or unexported fields
}
part of the shlibdeps
func NewSymbolsFile ¶
func NewSymbolsFile() *SymbolsFile
func (*SymbolsFile) GetSymbols ¶
func (smb *SymbolsFile) GetSymbols() []SymbolElement
GetSymbols returns parsed symbols file data
type Trigger ¶
type Trigger struct {
// contains filtered or unexported fields
}
func NewTrigger ¶
func NewTrigger() *Trigger
type TriggerFile ¶
type TriggerFile struct {
// contains filtered or unexported fields
}
func NewTriggerFile ¶
func NewTriggerFile() *TriggerFile
func (TriggerFile) Triggers ¶
func (tf TriggerFile) Triggers() []Trigger
Triggers return known parsed triggers