Documentation
¶
Index ¶
- type ContextKey
- type Package
- type PackageOption
- func WithArchitecture(arch string) PackageOption
- func WithInitrdConfig(initrd *initrd.InitrdConfig) PackageOption
- func WithKernel(kernel string) PackageOption
- func WithLocalLocation(location string, force bool) PackageOption
- func WithLogger(l log.Logger) PackageOption
- func WithMetadata(metadata map[string]interface{}) PackageOption
- func WithName(name string) PackageOption
- func WithPlatform(plat string) PackageOption
- func WithRemoteLocation(location string) PackageOption
- func WithType(t unikraft.ComponentType) PackageOption
- func WithVersion(version string) PackageOption
- func WithWorkdir(dir string) PackageOption
- type PackageOptions
- type PullPackageOption
- func WithPullArchitecture(archs ...string) PullPackageOption
- func WithPullCache(cache bool) PullPackageOption
- func WithPullChecksum(calc bool) PullPackageOption
- func WithPullLogger(l log.Logger) PullPackageOption
- func WithPullPlatform(plats ...string) PullPackageOption
- func WithPullProgressFunc(onProgress func(progress float64)) PullPackageOption
- func WithPullWorkdir(workdir string) PullPackageOption
- type PullPackageOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextKey ¶
type ContextKey string
type Package ¶
type Package interface { // Options allows you to view the current options. Options() *PackageOptions // ApplyOptions allows one to update the options of a package ApplyOptions(opts ...PackageOption) error // Determine if the provided path is a compatible media type Compatible(string) bool // Name is the simple package name Name() string // CanonicalName represents the full name which can be understood by the // respective package manager. CanonicalName() string // Package a package Pack() error // Pull retreives the package artifacts given the context of the // PackageOptions and allows for customization of the pull via the input // optional PullPackageOptions Pull(opts ...PullPackageOption) error // Format returns the name of the implementation. Format() string }
type PackageOption ¶
type PackageOption func(opts *PackageOptions) error
func WithArchitecture ¶
func WithArchitecture(arch string) PackageOption
func WithInitrdConfig ¶
func WithInitrdConfig(initrd *initrd.InitrdConfig) PackageOption
WithInitrdConfig sets the metadata attribute with the interface representing initrd configuration
func WithKernel ¶
func WithKernel(kernel string) PackageOption
WithKerenl sets the metadata attribute path to the kernel image
func WithLocalLocation ¶
func WithLocalLocation(location string, force bool) PackageOption
WithLocalLocation sets the location of the package to be stored locally.
func WithLogger ¶
func WithLogger(l log.Logger) PackageOption
func WithMetadata ¶
func WithMetadata(metadata map[string]interface{}) PackageOption
func WithName ¶
func WithName(name string) PackageOption
func WithPlatform ¶
func WithPlatform(plat string) PackageOption
func WithRemoteLocation ¶
func WithRemoteLocation(location string) PackageOption
WithRemoteLocation sets the location of the package at its remote registry
func WithType ¶
func WithType(t unikraft.ComponentType) PackageOption
func WithVersion ¶
func WithVersion(version string) PackageOption
func WithWorkdir ¶
func WithWorkdir(dir string) PackageOption
type PackageOptions ¶
type PackageOptions struct { // Name of the package Name string // Type of package Type unikraft.ComponentType // Version of the package Version string // Architecture of the package if applicable Architecture *string // Platform of the package if applicable Platform *string // Kernel is the path on disk to the kernel Kernel string // Initrd contains the configuration for the initramfs file Initrd *initrd.InitrdConfig // Metadata represents other items that did not have appropriate annotations Metadata map[string]interface{} // RemoteLocation contains the remote location of the package. RemoteLocation string // LocalLocation contains the path to save or store the package on the host. LocalLocation string // Sha256 Sha256 string // contains filtered or unexported fields }
PackageOptions contains configuration for the Package
func NewPackageOptions ¶
func NewPackageOptions(opts ...PackageOption) (*PackageOptions, error)
NewPackageOptions creates PackageOptions
func (*PackageOptions) ArchPlatString ¶
func (opts *PackageOptions) ArchPlatString() string
ArchPlatString returns the string representation of the architecture and platform combination for this package
func (*PackageOptions) Log ¶
func (opts *PackageOptions) Log() log.Logger
func (*PackageOptions) NameVersion ¶
func (opts *PackageOptions) NameVersion() string
NameVersion returns the string representation of name and version of this package
func (*PackageOptions) TypeNameVersion ¶
func (opts *PackageOptions) TypeNameVersion() string
TypeNameVersion returns the string representation of the type, name and version of this package
func (*PackageOptions) Workdir ¶
func (opts *PackageOptions) Workdir() string
type PullPackageOption ¶
type PullPackageOption func(opts *PullPackageOptions) error
func WithPullArchitecture ¶
func WithPullArchitecture(archs ...string) PullPackageOption
WithPullArchitecture requests a given architecture (if applicable)
func WithPullCache ¶
func WithPullCache(cache bool) PullPackageOption
WithPullCache to set whether use cache if possible
func WithPullChecksum ¶
func WithPullChecksum(calc bool) PullPackageOption
WithPullChecksum to set whether to calculate and compare the checksum of the package
func WithPullLogger ¶
func WithPullLogger(l log.Logger) PullPackageOption
WithPullLogger set the use of a logger
func WithPullPlatform ¶
func WithPullPlatform(plats ...string) PullPackageOption
WithPullPlatform requests a given platform (if applicable)
func WithPullProgressFunc ¶
func WithPullProgressFunc(onProgress func(progress float64)) PullPackageOption
WithPullProgressFunc set an optional progress function which is used as a callback during the transmission of the package and the host
func WithPullWorkdir ¶
func WithPullWorkdir(workdir string) PullPackageOption
WithPullWorkdir set the working directory context of the pull such that the resources of the package are placed there appropriately
type PullPackageOptions ¶
type PullPackageOptions struct {
// contains filtered or unexported fields
}
func NewPullPackageOptions ¶
func NewPullPackageOptions(opts ...PullPackageOption) (*PullPackageOptions, error)
NewPullPackageOptions creates PullPackageOptions
func (*PullPackageOptions) CalculateChecksum ¶
func (ppo *PullPackageOptions) CalculateChecksum() bool
CalculateChecksum returns whether the pull request should perform a check of the resource sum.
func (*PullPackageOptions) Log ¶
func (ppo *PullPackageOptions) Log() log.Logger
Log returns the available logger
func (*PullPackageOptions) OnProgress ¶
func (ppo *PullPackageOptions) OnProgress(progress float64)
OnProgress calls (if set) an embedded progress function which can be used to update an external progress bar, for example.
func (*PullPackageOptions) UseCache ¶
func (ppo *PullPackageOptions) UseCache() bool
UseCache returns whether the pull should redirect to using a local cache if available.
func (*PullPackageOptions) Workdir ¶
func (ppo *PullPackageOptions) Workdir() string
Workdir returns the set working directory as part of the pull request