management

package
v0.0.0-...-09d2199 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package management provides a backend-agnostic interface for bare metal power control.

Index

Constants

This section is empty.

Variables

View Source
var ErrTransitioning = errors.New("power state transition already in progress")

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPowerState(ctx context.Context, hostID string) (*PowerStatus, error)
	SetPowerState(ctx context.Context, hostID string, target PowerState) error
}

func NewClient

func NewClient(ctx context.Context, cfg *Config) (Client, error)

func NewOpenStackClient

func NewOpenStackClient(ctx context.Context, cfg *Config) (Client, error)

type Config

type Config struct {
	Name    string         `json:"name"`
	Type    string         `json:"type"`
	Options map[string]any `json:"options"`
}

type NewClientFunc

type NewClientFunc func(ctx context.Context, cfg *Config) (Client, error)

type OpenStackClient

type OpenStackClient struct {
	// contains filtered or unexported fields
}

func (*OpenStackClient) GetPowerState

func (c *OpenStackClient) GetPowerState(ctx context.Context, hostID string) (*PowerStatus, error)

func (*OpenStackClient) SetPowerState

func (c *OpenStackClient) SetPowerState(ctx context.Context, hostID string, target PowerState) error

type PowerState

type PowerState string
const (
	PowerOn  PowerState = "power on"
	PowerOff PowerState = "power off"
)

type PowerStatus

type PowerStatus struct {
	State           PowerState
	IsTransitioning bool
}

Jump to

Keyboard shortcuts

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