component

package
v0.2.2-2-g52bb9ff Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.

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 returns human-readable information about the component
	PrintInfo() string
}

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) SetWorkdir added in v0.2.0

func (cc *ComponentConfig) SetWorkdir(workdir string)

SetWorkdir sets the instantiated component's working directory

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 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