Documentation ¶
Overview ¶
Package debian implements Debian-specific repository handling
Index ¶
- type Package
- type PackageList
- type PackageRefList
- type RemoteRepo
- func (repo *RemoteRepo) BinaryURL(component string, architecture string) *url.URL
- func (repo *RemoteRepo) Decode(input []byte) error
- func (repo *RemoteRepo) Download(d utils.Downloader, db database.Storage, packageRepo *Repository) error
- func (repo *RemoteRepo) Encode() []byte
- func (repo *RemoteRepo) Fetch(d utils.Downloader) error
- func (repo *RemoteRepo) Key() []byte
- func (repo *RemoteRepo) NumPackages() int
- func (repo *RemoteRepo) PackageURL(filename string) *url.URL
- func (repo *RemoteRepo) RefKey() []byte
- func (repo *RemoteRepo) ReleaseURL() *url.URL
- func (repo *RemoteRepo) String() string
- type RemoteRepoCollection
- func (collection *RemoteRepoCollection) Add(repo *RemoteRepo) error
- func (collection *RemoteRepoCollection) ByName(name string) (*RemoteRepo, error)
- func (collection *RemoteRepoCollection) ForEach(handler func(*RemoteRepo))
- func (collection *RemoteRepoCollection) LoadComplete(repo *RemoteRepo) error
- func (collection *RemoteRepoCollection) Update(repo *RemoteRepo) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Package ¶
type Package struct { Name string Version string Filename string Filesize int64 Architecture string Depends []string PreDepends []string Suggests []string Recommends []string Extra debc.Paragraph }
Package is single instance of Debian package
TODO: support source & binary
func NewPackageFromControlFile ¶
NewPackageFromControlFile creates Package from parsed Debian control file
func (*Package) VerifyFile ¶
VerifyFile verifies integrity and existence of local files for the package
type PackageList ¶
type PackageList struct {
// contains filtered or unexported fields
}
PackageList is list of unique (by key) packages
It could be seen as repo snapshot, repo contents, result of filtering, merge, etc.
func (*PackageList) Add ¶
func (l *PackageList) Add(p *Package) error
Add appends package to package list, additionally checking for uniqueness
func (*PackageList) ForEach ¶
func (l *PackageList) ForEach(handler func(*Package))
ForEach calls handler for each package in list
TODO: Error handling
func (*PackageList) Len ¶
func (l *PackageList) Len() int
Len returns number of packages in the list
type PackageRefList ¶
type PackageRefList struct { // List of package keys Refs [][]byte }
PackageRefList is a list of keys of packages, this is basis for snapshot and similar stuff
Refs are sorted in lexographical order
func NewPackageRefListFromPackageList ¶
func NewPackageRefListFromPackageList(list *PackageList) *PackageRefList
NewPackageRefListFromPackageList creates PackageRefList from PackageList
func (*PackageRefList) Decode ¶
func (l *PackageRefList) Decode(input []byte) error
Decode decodes msgpack representation into PackageRefLit
func (*PackageRefList) Encode ¶
func (l *PackageRefList) Encode() []byte
Encode does msgpack encoding of PackageRefList
func (*PackageRefList) Less ¶
func (l *PackageRefList) Less(i, j int) bool
Compare compares two refs in lexographical order
type RemoteRepo ¶
type RemoteRepo struct { // Permanent internal ID UUID string // User-assigned name Name string // Root of Debian archive, URL ArchiveRoot string // Distribution name, e.g. squeeze Distribution string // List of components to fetch, if empty, then fetch all components Components []string // List of architectures to fetch, if empty, then fetch all architectures Architectures []string // Meta-information about repository Meta debc.Paragraph // Last update date LastDownloadDate time.Time // contains filtered or unexported fields }
RemoteRepo represents remote (fetchable) Debian repository.
Repostitory could be filtered when fetching by components, architectures TODO: support flat format
func NewRemoteRepo ¶
func NewRemoteRepo(name string, archiveRoot string, distribution string, components []string, architectures []string) (*RemoteRepo, error)
NewRemoteRepo creates new instance of Debian remote repository with specified params
func (*RemoteRepo) BinaryURL ¶
func (repo *RemoteRepo) BinaryURL(component string, architecture string) *url.URL
BinaryURL returns URL of Packages file for given component and architecture
func (*RemoteRepo) Decode ¶
func (repo *RemoteRepo) Decode(input []byte) error
Decode decodes msgpack representation into RemoteRepo
func (*RemoteRepo) Download ¶
func (repo *RemoteRepo) Download(d utils.Downloader, db database.Storage, packageRepo *Repository) error
Download downloads all repo files
func (*RemoteRepo) Encode ¶
func (repo *RemoteRepo) Encode() []byte
Encode does msgpack encoding of RemoteRepo
func (*RemoteRepo) Fetch ¶
func (repo *RemoteRepo) Fetch(d utils.Downloader) error
Fetch updates information about repository
func (*RemoteRepo) NumPackages ¶
func (repo *RemoteRepo) NumPackages() int
NumPackages return number of packages retrived from remore repo
func (*RemoteRepo) PackageURL ¶
func (repo *RemoteRepo) PackageURL(filename string) *url.URL
PackageURL returns URL of package file relative to repository root architecture
func (*RemoteRepo) RefKey ¶
func (repo *RemoteRepo) RefKey() []byte
RefKey is a unique id for package reference list
func (*RemoteRepo) ReleaseURL ¶
func (repo *RemoteRepo) ReleaseURL() *url.URL
ReleaseURL returns URL to Release file in repo root TODO: InRelease, Release.gz, Release.bz2 handling
type RemoteRepoCollection ¶
type RemoteRepoCollection struct {
// contains filtered or unexported fields
}
RemoteRepoCollection does listing, updating/adding/deleting of RemoteRepos
func NewRemoteRepoCollection ¶
func NewRemoteRepoCollection(db database.Storage) *RemoteRepoCollection
NewRemoteRepoCollection loads RemoteRepos from DB and makes up collection
func (*RemoteRepoCollection) Add ¶
func (collection *RemoteRepoCollection) Add(repo *RemoteRepo) error
Add appends new repo to collection and saves it
func (*RemoteRepoCollection) ByName ¶
func (collection *RemoteRepoCollection) ByName(name string) (*RemoteRepo, error)
ByName looks up repository by name
func (*RemoteRepoCollection) ForEach ¶
func (collection *RemoteRepoCollection) ForEach(handler func(*RemoteRepo))
ForEach runs method for each repository
func (*RemoteRepoCollection) LoadComplete ¶
func (collection *RemoteRepoCollection) LoadComplete(repo *RemoteRepo) error
LoadComplete loads additional information for remote repo
func (*RemoteRepoCollection) Update ¶
func (collection *RemoteRepoCollection) Update(repo *RemoteRepo) error
Update stores updated information about repo in DB
type Repository ¶
type Repository struct {
RootPath string
}
Repository abstract file system with package pool and published package repos
func NewRepository ¶
func NewRepository(root string) *Repository
NewRepository creates new instance of repository which specified root