types

package
v0.0.0-alpha.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PullAll

func PullAll() error

Types

type Config

type Config struct {
	Logging Logging `yaml:"logging"`

	Profiles map[string]*Profile `yaml:"profiles"`

	// MimeHandler configures mime types and the specific workloads to handle them.
	MimeHandlers map[string]MimeHandler `yaml:"mimeHandlers"`

	DefaultMimeHandler *MimeHandler `yaml:"defaultMimeHandler"`

	// WorkloadPullMode defines how workload images should be pulled.
	WorkloadPullMode WorkloadPullMode `yaml:"workloadPullMode"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type EffectiveWorkload

type EffectiveWorkload struct {
	// Name combines the name of both the workload and the profile
	// in which it will be executed under.
	Name     string
	Profile  *Profile
	Workload Workload
}

func (EffectiveWorkload) Validate

func (w EffectiveWorkload) Validate() error

type HostAccess

type HostAccess struct {
	X11        bool   `yaml:"x11"`
	Camera     bool   `yaml:"camera"`
	Microphone bool   `yaml:"microphone"`
	Speakers   bool   `yaml:"speakers"`
	Smartcard  bool   `yaml:"smartcard"`
	Network    string `yaml:"network"`
	VarRunUser bool   `yaml:"varRunUser"`
	Privileged bool   `yaml:"privileged"`
	Mime       bool   `yaml:"mime"`

	Bluetooth bool `yaml:"bluetooth"`

	// MachineID defines whether the workload should share the same
	// machine id as the host.
	MachineID bool `yaml:"machineId"`

	// LocalTime defines whether the workload should share the same
	// local time as the host.
	LocalTime bool `yaml:"localTime"`
}

type Logging

type Logging struct {
	LogToFile   bool   `yaml:"logToFile"`
	LogToStdout bool   `yaml:"logToStdout"`
	LogToSyslog bool   `yaml:"logToSyslog"`
	Level       string `yaml:"level"`
}

type MimeHandler

type MimeHandler struct {
	Workload string `yaml:"workload"`
	Profile  string `yaml:"profile"`
}

type Profile

type Profile struct {
	Name string
	// Path defines the root path for the given profile. All other
	// paths (e.g. Paths) will descend from it.
	//
	// Note that this Path descends from the dir where the qubesome
	// config is being consumed. When sourcing from git, it descends
	// from the git repository directory.
	Path   string
	Runner string // TODO: Better name runner

	HostAccess `yaml:"hostAccess"`

	// TODO: Rename to USB named devices
	NamedDevices []string `yaml:"namedDevices"`

	Display uint8 `yaml:"display"`

	Paths []string `yaml:"paths"`
}

type Workload

type Workload struct {
	Name           string   `yaml:"name"`
	Image          string   `yaml:"image"`
	Command        string   `yaml:"command"`
	Args           []string `yaml:"args"`
	SingleInstance bool     `yaml:"singleInstance"`
	HostAccess     `yaml:"hostAccess"`
	Paths          []string `yaml:"paths"`
	HomePaths      []string `yaml:"homePaths"`
	Volumes        []string `yaml:"volumes"`
	MimeApps       []string `yaml:"mimeApps"`

	// TODO: Rename to USB Named Devices
	// grep -R HID_NAME /sys/class/hidraw/*/device/uevent | cut -d'=' -f2
	NamedDevices []string `yaml:"namedDevices"`
	Runner       string   `yaml:"runner"`
}

func (Workload) ApplyProfile

func (w Workload) ApplyProfile(p *Profile) EffectiveWorkload

func (Workload) Validate

func (w Workload) Validate() error

type WorkloadPullMode

type WorkloadPullMode string
const (
	// OnDemand is a no-op and won't preemptively pull workload images.
	// This is the default behaviour.
	OnDemand WorkloadPullMode = "on-demand"
	// Background downloads all workload images on the background when
	// any command is executed. This operation will only take place once
	// a day.
	Background WorkloadPullMode = "background"
)

func (WorkloadPullMode) Pull

func (o WorkloadPullMode) Pull(wg *sync.WaitGroup) error

Jump to

Keyboard shortcuts

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