Documentation ¶
Index ¶
- Constants
- func PackageManagers() map[pack.ContextKey]PackageManager
- func RegisterPackageManager(ctxk pack.ContextKey, manager PackageManager) error
- type CatalogQuery
- type PackageManager
- type PackageManagerOption
- type PackageManagerOptions
- type UmbrellaManager
- func (um UmbrellaManager) AddSource(source string) error
- func (um UmbrellaManager) ApplyOptions(pmopts ...PackageManagerOption) error
- func (mm UmbrellaManager) Catalog(query CatalogQuery, popts ...pack.PackageOption) ([]pack.Package, error)
- func (um UmbrellaManager) Format() string
- func (um UmbrellaManager) From(sub string) (PackageManager, error)
- func (mm UmbrellaManager) IsCompatible(source string) (PackageManager, error)
- func (um UmbrellaManager) NewPackageFromOptions(ctx context.Context, opts *pack.PackageOptions) ([]pack.Package, error)
- func (um UmbrellaManager) Options() *PackageManagerOptions
- func (um UmbrellaManager) Pull(path string, opts *pack.PullPackageOptions) ([]pack.Package, error)
- func (um UmbrellaManager) Push(path string) error
- func (um UmbrellaManager) RemoveSource(source string) error
- func (um UmbrellaManager) Update() error
Constants ¶
const UmbrellaContext pack.ContextKey = "umbrella"
Variables ¶
This section is empty.
Functions ¶
func PackageManagers ¶
func PackageManagers() map[pack.ContextKey]PackageManager
func RegisterPackageManager ¶
func RegisterPackageManager(ctxk pack.ContextKey, manager PackageManager) error
Types ¶
type CatalogQuery ¶
type CatalogQuery struct { // Source specifies where the origin of the package Source string // Types specifies the associated list of possible types for the package Types []unikraft.ComponentType // Name specifies the name of the package Name string // Version specifies the version of the package Version string // NoCache forces the package manager to update values in-memory without // interacting with any underlying cache NoCache bool }
CatalogQuery is the request structure with associated attributes which are used to search the package manager's catalog
func NewCatalogQuery ¶
func NewCatalogQuery(s string) CatalogQuery
func (CatalogQuery) String ¶
func (cq CatalogQuery) String() string
type PackageManager ¶
type PackageManager interface { // NewPackage initializes a new package NewPackageFromOptions(context.Context, *pack.PackageOptions) ([]pack.Package, error) // Options allows you to view the current options. Options() *PackageManagerOptions // ApplyOptions allows one to update the options of a package manager ApplyOptions(...PackageManagerOption) error // Update retrieves and stores locally a cache of the upstream registry. Update() error // Push a package to the supported registry of the implementation. Push(string) error // Pull package(s) from the supported registry of the implementation. Pull(string, *pack.PullPackageOptions) ([]pack.Package, error) // Catalog returns all packages known to the manager via given query Catalog(CatalogQuery, ...pack.PackageOption) ([]pack.Package, error) // Add a source to the package manager AddSource(string) error // Remove a source from the package manager RemoveSource(string) error // IsCompatible checks whether the provided source is compatible with the // package manager IsCompatible(string) (PackageManager, error) // From is used to retrieve a sub-package manager. For now, this is a small // hack used for the umbrella. From(string) (PackageManager, error) // Format returns the name of the implementation. Format() string }
func NewUmbrellaManagerFromOptions ¶
func NewUmbrellaManagerFromOptions(opts *PackageManagerOptions) (PackageManager, error)
type PackageManagerOption ¶
type PackageManagerOption func(opts *PackageManagerOptions) error
func WithConfigManager ¶
func WithConfigManager(cm *config.ConfigManager) PackageManagerOption
WithConfig provides access to global config
func WithLogger ¶
func WithLogger(l log.Logger) PackageManagerOption
WithLogger defines the log.Logger
type PackageManagerOptions ¶
type PackageManagerOptions struct { ConfigManager *config.ConfigManager Log log.Logger // contains filtered or unexported fields }
PackageManagerOptions contains configuration for the Package
func NewPackageManagerOptions ¶
func NewPackageManagerOptions(ctx context.Context, opts ...PackageManagerOption) (*PackageManagerOptions, error)
NewPackageManagerOptions creates PackageManagerOptions
func (*PackageManagerOptions) Context ¶
func (pmopts *PackageManagerOptions) Context() context.Context
type UmbrellaManager ¶
type UmbrellaManager struct {
// contains filtered or unexported fields
}
UmbrellaManager is an ad-hoc package manager capable of cross managing any registered package manager.
func (UmbrellaManager) AddSource ¶
func (um UmbrellaManager) AddSource(source string) error
func (UmbrellaManager) ApplyOptions ¶
func (um UmbrellaManager) ApplyOptions(pmopts ...PackageManagerOption) error
func (UmbrellaManager) Catalog ¶
func (mm UmbrellaManager) Catalog(query CatalogQuery, popts ...pack.PackageOption) ([]pack.Package, error)
func (UmbrellaManager) Format ¶
func (um UmbrellaManager) Format() string
func (UmbrellaManager) From ¶
func (um UmbrellaManager) From(sub string) (PackageManager, error)
func (UmbrellaManager) IsCompatible ¶
func (mm UmbrellaManager) IsCompatible(source string) (PackageManager, error)
IsCompatible iterates through all package managers and returns the first package manager which is compatible with the provided source
func (UmbrellaManager) NewPackageFromOptions ¶
func (um UmbrellaManager) NewPackageFromOptions(ctx context.Context, opts *pack.PackageOptions) ([]pack.Package, error)
func (UmbrellaManager) Options ¶
func (um UmbrellaManager) Options() *PackageManagerOptions
Options allows you to view the current options.
func (UmbrellaManager) Pull ¶
func (um UmbrellaManager) Pull(path string, opts *pack.PullPackageOptions) ([]pack.Package, error)
Pull a package from the support registry of the implementation.
func (UmbrellaManager) Push ¶
func (um UmbrellaManager) Push(path string) error
Push the resulting package to the supported registry of the implementation.
func (UmbrellaManager) RemoveSource ¶
func (um UmbrellaManager) RemoveSource(source string) error
func (UmbrellaManager) Update ¶
func (um UmbrellaManager) Update() error
Update retrieves and stores locally a