Documentation ¶
Overview ¶
packages is utilities for working with Debian packages and package lists.
Index ¶
- func AllAvailable(store *storage.Service) (map[string][]*Package, error)
- func AllAvailableByPackageName(store *storage.Service) (map[string]*Package, error)
- func FromLocalFile(filename string) ([]string, error)
- func Install(ctx context.Context, client *http.Client, store *storage.Service, name string) error
- func PutInstalled(store *storage.Service, serverName string, packages []string, generation int64) error
- func SetBucketName(s string)
- func ToLocalFile(packages []string, filename string) error
- type AllInfo
- func (a *AllInfo) AllAvailable() map[string][]*Package
- func (a *AllInfo) AllAvailableByPackageName() map[string]*Package
- func (a *AllInfo) AllInstalled() map[string]*Installed
- func (a *AllInfo) ForceRefresh() error
- func (a *AllInfo) PutInstalled(serverName string, packages []string, generation int64) error
- type Installed
- type Package
- type PackageConfig
- type PackageSlice
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllAvailable ¶
AllAvailable returns all known packages for all applications uploaded to gs://<bucketName>/debs/.
func AllAvailableByPackageName ¶
AllAvailableByPackageName returns all known packages for all applications uploaded to gs://<bucketName>/debs/. They are mapped by the package name.
func FromLocalFile ¶
FromLocalFile loads a list of installed debian package names from a local file.
func PutInstalled ¶
func PutInstalled(store *storage.Service, serverName string, packages []string, generation int64) error
PutInstalled writes a new list of installed packages for the given server.
func SetBucketName ¶
func SetBucketName(s string)
func ToLocalFile ¶
ToLocalFile writes a list of debian packages to a local file.
Types ¶
type AllInfo ¶
type AllInfo struct {
// contains filtered or unexported fields
}
AllInfo keeps a cache of all installed packages and all available to be installed packages.
func NewAllInfo ¶
func (*AllInfo) AllAvailable ¶
func (*AllInfo) AllAvailableByPackageName ¶
AllAvailableByPackageName returns all known packages for all applications uploaded to gs://<bucketName>/debs/. They are mapped by the package name.
func (*AllInfo) AllInstalled ¶
func (*AllInfo) ForceRefresh ¶
type Installed ¶
type Installed struct { // Names is a list of package names, of the form "{appname}/{appname}:{author}:{date}:{githash}.deb" Names []string // Generation is the Google Storage generation number of the config file at the time we read it. // Use this to avoid the lost-update problem: https://cloud.google.com/storage/docs/generations-preconditions#_ReadModWrite Generation int64 }
Installed is a list of all the packages installed on a server.
type Package ¶
type Package struct { Name string // The unique name of this release package. Hash string UserID string Built time.Time Dirty bool Note string Services []string }
Package represents a single Debian package uploaded to Google Storage.
func AllAvailableApp ¶
AllAvailableApp returns all known packages for the given applications uploaded to gs://<bucketName>/debs/<appname>.
type PackageConfig ¶
type PackageConfig struct {
Servers map[string]ServerConfig
}
PackageConfig is the configuration of the application.
It is a list of servers (by GCE domain name) and the list of apps that are allowed to be installed on them. It is loaded from infra/push/skiapush.json5 in JSON5 format.
func LoadPackageConfig ¶
func LoadPackageConfig(filename string) (PackageConfig, error)
func New ¶
func New() PackageConfig
func (*PackageConfig) AllServerNames ¶
func (p *PackageConfig) AllServerNames() []string
func (*PackageConfig) AllServerNamesWithPackage ¶
func (p *PackageConfig) AllServerNamesWithPackage(name string) []string
type PackageSlice ¶
type PackageSlice []*Package
PackageSlice is for sorting Packages by Built time.
func (PackageSlice) Len ¶
func (p PackageSlice) Len() int
func (PackageSlice) Less ¶
func (p PackageSlice) Less(i, j int) bool
func (PackageSlice) String ¶
func (p PackageSlice) String() string
func (PackageSlice) Swap ¶
func (p PackageSlice) Swap(i, j int)
type ServerConfig ¶
type ServerConfig struct {
AppNames []string
}
ServerConfig is used in PackageConfig.