lxd_device

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LxdSock = "/var/snap/lxd/common/lxd/unix.socket"
)

Variables

This section is empty.

Functions

func MockLxdServerInfo

func MockLxdServerInfo(f func(ctx context.Context) (*api.Resources, error)) func()

MockLxdServerInfo replaces the LXD server info function used by NewSpecification and returns a restore function.

func MockWorkshopFs

func MockWorkshopFs(f func(conn lxd.InstanceServer, pid, w string) (fsutil.Fs, error)) func()

Types

type Backend

type Backend struct {
}

func (*Backend) Initialize

func (b *Backend) Initialize() error

func (*Backend) Name

func (b *Backend) Name() interfaces.SecuritySystem

Name returns the name of the backend.

func (*Backend) NewSpecification

func (b *Backend) NewSpecification(user string, sdk string) (interfaces.Specification, error)

NewSpecification returns a new SDK specification.

func (*Backend) Remove

func (b *Backend) Remove(ctx context.Context, sdkRef sdk.Ref) error

Remove removes profile of a given sdk.

This method should be called after removing a sdk.

func (*Backend) Setup

func (b *Backend) Setup(ctx context.Context, sdkRef sdk.Ref, repo *interfaces.Repository) error

Setup creates mount profile specific to a given sdk.

type Specification

type Specification struct {
	Profile workshop.SdkProfile

	User        *user.User
	Environment map[string]string
	// contains filtered or unexported fields
}

func NewSpecification

func NewSpecification(user string, sdk string) (*Specification, error)

func (*Specification) AddConnectedPlug

func (s *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error

AddConnectedPlug records side-effects of having a connected plug.

func (*Specification) AddConnectedSlot

func (s *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error

AddConnectedSlot records side-effects of having a connected slot.

func (*Specification) AddCustomDevice added in v0.9.1

func (s *Specification) AddCustomDevice(device workshop.CustomDevice) error

func (*Specification) AddMountEntry

func (s *Specification) AddMountEntry(dev workshop.Mount) error

func (*Specification) AddPermanentPlug

func (s *Specification) AddPermanentPlug(iface interfaces.Interface, plug *sdk.PlugInfo) error

AddPermanentPlug records side-effects of having a plug.

func (*Specification) AddPermanentSlot

func (s *Specification) AddPermanentSlot(iface interfaces.Interface, slot *sdk.SlotInfo) error

AddPermanentSlot records side-effects of having a slot.

func (*Specification) AddTunnelEntry

func (s *Specification) AddTunnelEntry(tunnel workshop.Tunnel) error

func (*Specification) SetCamera

func (s *Specification) SetCamera(camera workshop.Camera) error

func (*Specification) SetDesktop

func (s *Specification) SetDesktop(desktop workshop.Desktop) error

func (*Specification) SetGpu

func (s *Specification) SetGpu(gpu workshop.Gpu) error

func (*Specification) SetSshAgent

func (s *Specification) SetSshAgent(agent workshop.SshAgent) error

Jump to

Keyboard shortcuts

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