component

package
v0.1.0-14-gc7c31ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameAndVersion

func NameAndVersion(component Component) string

NameAndVersion accepts a component and provids the canonical string representation of the component with its name and version

Types

type Component

type Component interface {
	// Name returns the component name
	Name() string

	// Source returns the component source
	Source() string

	// Version returns the component version
	Version() string

	// Type returns the component's static constant type
	Type() unikraft.ComponentType

	// Component returns the component's configuration
	Component() ComponentConfig

	// KConfigMenu returns the component's KConfig configuration menu which
	// returns all possible options for the component
	KConfigMenu() (*kconfig.KConfigFile, error)

	// KConfigValeus returns the component's set of file KConfig which is known
	// when the relevant component packages have been retrieved
	KConfigValues() (kconfig.KConfigValues, error)

	// PrintInfo displays the information about the component via the provided
	// iostream
	PrintInfo(*iostreams.IOStreams) error
}

Component is the abstract interface for managing the individual microlibrary

type ComponentConfig

type ComponentConfig struct {
	Name          string                `yaml:",omitempty" json:"-"`
	Version       string                `yaml:",omitempty" json:"version,omitempty"`
	Source        string                `yaml:",omitempty" json:"source,omitempty"`
	Configuration kconfig.KConfigValues `yaml:",omitempty" json:"kconfig,omitempty"`

	Extensions map[string]interface{} `yaml:",inline" json:"-"`
	// contains filtered or unexported fields
}

ComponentConfig is the shared attribute structure provided to all microlibraries, whether they are a library, platform, architecture, an application itself or the Unikraft core.

func ParseComponentConfig

func ParseComponentConfig(name string, props interface{}) (ComponentConfig, error)

ParseComponentConfig parse short syntax for Component configuration

func (*ComponentConfig) ApplyOptions

func (cc *ComponentConfig) ApplyOptions(opts ...ComponentOption) error

func (*ComponentConfig) IsUnpackedInProject

func (cc *ComponentConfig) IsUnpackedInProject() bool

IsUnpackedInProject indicates whether the package has been unpacked into a project specified by the working directory option

func (*ComponentConfig) Log

func (cc *ComponentConfig) Log() log.Logger

func (*ComponentConfig) SourceDir

func (cc *ComponentConfig) SourceDir() (string, error)

SourceDir returns the well-known location of the component given its working directory, type and name.

func (*ComponentConfig) Workdir

func (cc *ComponentConfig) Workdir() string

Workdir exposes the instantiated component's working directory

type ComponentOption

type ComponentOption func(cc *ComponentConfig) error

func WithContext

func WithContext(ctx context.Context) ComponentOption

func WithLogger

func WithLogger(log log.Logger) ComponentOption

func WithPackageManager

func WithPackageManager(pm *packmanager.PackageManager) ComponentOption

func WithWorkdir

func WithWorkdir(path string) ComponentOption

type Extensions

type Extensions map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL