host

package
v0.0.0-...-bea6086 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultImagesDir  = "images"
	DefaultPluginsDir = "plugins"

	DefaultMachinesDir                 = "machines"
	DefaultStoreDir                    = "store"
	DefaultMachineStoreDir             = "machines"
	DefaultMachineVolumesDir           = "volumes"
	DefaultMachineIgnitionsDir         = "ignitions"
	DefaultMachineIgnitionFile         = "data.ign"
	DefaultMachineRootFSDir            = "rootfs"
	DefaultMachineRootFSFile           = "rootfs"
	DefaultMachinePluginsDir           = "plugins"
	DefaultMachineNetworkInterfacesDir = "networkinterfaces"
)

Variables

This section is empty.

Functions

func IterateMachineNetworkInterfaces

func IterateMachineNetworkInterfaces(paths Paths, machineUID string, f func(networkInterfaceName string) error) error

func IterateMachines

func IterateMachines(paths Paths, f func(machineUID string) error) error

func MakeMachineDirs

func MakeMachineDirs(paths Paths, machineUID string) error

func ReadMachineUIDs

func ReadMachineUIDs(paths Paths) ([]string, error)

Types

type CreateStrategy

type CreateStrategy[E api.Object] interface {
	PrepareForCreate(obj E)
}

type Host

type Host interface {
	Paths
	APINetClient() client.Client
	OCIStore() *ocistore.Store
}

func NewAt

func NewAt(apinetClient client.Client, rootDir string) (Host, error)

type LibvirtHost

type LibvirtHost interface {
	Host
	Libvirt() *libvirt.Libvirt
}

func NewLibvirtAt

func NewLibvirtAt(apinetClient client.Client, rootDir string, libvirt *libvirt.Libvirt) (LibvirtHost, error)

type MachineNetworkInterface

type MachineNetworkInterface struct {
	NetworkInterfaceName string
}

func ReadMachineNetworkInterfaces

func ReadMachineNetworkInterfaces(paths Paths, machineUID string) ([]MachineNetworkInterface, error)

type MachineVolume

type MachineVolume struct {
	PluginName        string
	ComputeVolumeName string
}

type Options

type Options[E api.Object] struct {
	//TODO
	Dir            string
	NewFunc        func() E
	CreateStrategy CreateStrategy[E]
}

type Paths

type Paths interface {
	RootDir() string
	StoreDir() string

	MachinesDir() string
	MachineStoreDir() string
	ImagesDir() string
	PluginsDir() string

	PluginDir(pluginName string) string
	MachinePluginsDir(machineUID string) string
	MachinePluginDir(machineUID string, pluginName string) string

	MachineDir(machineUID string) string
	MachineRootFSDir(machineUID string) string
	MachineRootFSFile(machineUID string) string
	MachineVolumesDir(machineUID string) string

	MachineVolumesPluginDir(machineUID string, pluginName string) string
	MachineVolumeDir(machineUID string, pluginName, volumeName string) string

	MachineNetworkInterfacesDir(machineUID string) string
	MachineNetworkInterfaceDir(machineUID string, networkInterfaceName string) string

	MachineIgnitionsDir(machineUID string) string
	MachineIgnitionFile(machineUID string) string
}

func PathsAt

func PathsAt(rootDir string) (Paths, error)

type Store

type Store[E api.Object] struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore[E api.Object](opts Options[E]) (*Store[E], error)

func (*Store[E]) Create

func (s *Store[E]) Create(_ context.Context, obj E) (E, error)

func (*Store[E]) Delete

func (s *Store[E]) Delete(_ context.Context, id string) error

func (*Store[E]) Get

func (s *Store[E]) Get(_ context.Context, id string) (E, error)

func (*Store[E]) List

func (s *Store[E]) List(ctx context.Context) ([]E, error)

func (*Store[E]) Update

func (s *Store[E]) Update(_ context.Context, obj E) (E, error)

func (*Store[E]) Watch

func (s *Store[E]) Watch(_ context.Context) (store.Watch[E], error)

Jump to

Keyboard shortcuts

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