platform

package
v0.5.2-147-g5e31ad2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: BSD-3-Clause Imports: 14 Imported by: 1

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 except 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 except 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 except 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 except in compliance with the License.

Index

Constants

View Source
const (
	SystemUnknown = SystemMode("unknown")
	SystemGuest   = SystemMode("guest")
	SystemHost    = SystemMode("host")
)
View Source
const (
	PlatformUnknown     = Platform("unknown")
	PlatformFirecracker = Platform("fc")
	PlatformKVM         = Platform("kvm")
	PlatformQEMU        = Platform("qemu")
	PlatformXen         = Platform("xen")
)

Variables

This section is empty.

Functions

func Detect

func Detect(ctx context.Context) (Platform, SystemMode, error)

Detect returns the hypervisor and system mode in the context to the determined hypervisor or an error if not detectable.

func DriverNames

func DriverNames() []string

DriverNames returns the list of registered platform driver implementation names.

func Platforms

func Platforms() map[string]Platform

Platforms returns the list of known platforms.

func Strategies

func Strategies() map[Platform]*Strategy

Strategies returns the list of registered platform implementations.

Types

type NewStrategyConstructor

type NewStrategyConstructor[T any] func(context.Context, ...any) (T, error)

NewStrategyConstructor is a prototype for the instantiation function of a platform driver implementation.

type Platform

type Platform string

func (Platform) String

func (ht Platform) String() string

String implements fmt.Stringer

type Strategy

type Strategy struct {
	Name               string
	Platform           Platform
	NewMachineV1alpha1 NewStrategyConstructor[machinev1alpha1.MachineService]
}

Strategy represents canonical reference of a machine driver and their platform.

type SystemMode

type SystemMode string

Jump to

Keyboard shortcuts

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