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.
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
- func Detect(ctx context.Context) (Platform, SystemMode, error)
- func DriverNames() []string
- func NewMachineV1alpha1ServiceIterator(ctx context.Context) (machinev1alpha1.MachineService, error)
- func Platforms() map[string]Platform
- func Strategies() map[Platform]*Strategy
- type NewStrategyConstructor
- type Platform
- type Strategy
- type SystemMode
Constants ¶
const ( SystemUnknown = SystemMode("unknown") SystemGuest = SystemMode("guest") SystemHost = SystemMode("host") )
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 NewMachineV1alpha1ServiceIterator ¶
func NewMachineV1alpha1ServiceIterator(ctx context.Context) (machinev1alpha1.MachineService, error)
NewMachineV1alpha1ServiceIterator returns a machinev1alpha1.MachineService-compatible implementation which iterates over each supported host platform and calls the representing method. This is useful in circumstances where the platform is not supplied. The first platform strategy to succeed is returned in all circumstances.
func Strategies ¶
Strategies returns the list of registered platform implementations.
Types ¶
type NewStrategyConstructor ¶
NewStrategyConstructor is a prototype for the instantiation function of a platform driver implementation.
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