driver

package
v0.0.0-...-3445758 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin(logger hclog.Logger) drivers.DriverPlugin

NewPlugin returns a new driver plugin

Types

type Config

type Config struct {
	Emulator string `codec:"emulator"`
}

Config contains configuration information for the plugin

type Disk

type Disk struct {
	Source string `codec:"source"`
	Driver Driver `codec:"driver"`
	Target string `codec:"target"`
	Device string `codec:"device"`
}

type Driver

type Driver struct {
	Name string `codec:"name"`
	Type string `codec:"type"`
}

type Interface

type Interface struct {
	Type   string `codec:"type"`
	Source string `codec:"source"`
}

type LibVirtDriverPlugin

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

func (*LibVirtDriverPlugin) CalculateVcpuCount

func (d *LibVirtDriverPlugin) CalculateVcpuCount(shares int64) int64

func (*LibVirtDriverPlugin) Capabilities

func (d *LibVirtDriverPlugin) Capabilities() (*drivers.Capabilities, error)

Capabilities returns the features supported by the driver.

func (*LibVirtDriverPlugin) ConfigSchema

func (d *LibVirtDriverPlugin) ConfigSchema() (*hclspec.Spec, error)

ConfigSchema returns the plugin configuration schema.

func (*LibVirtDriverPlugin) DestroyTask

func (d *LibVirtDriverPlugin) DestroyTask(taskID string, force bool) error

DestroyTask cleans up and removes a task that has terminated.

func (*LibVirtDriverPlugin) ExecTask

func (d *LibVirtDriverPlugin) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)

ExecTask returns the result of executing the given command inside a task. This is an optional capability.

func (*LibVirtDriverPlugin) Fingerprint

func (d *LibVirtDriverPlugin) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)

Fingerprint returns a channel that will be used to send health information and other driver specific node attributes.

func (*LibVirtDriverPlugin) InspectTask

func (d *LibVirtDriverPlugin) InspectTask(taskID string) (*drivers.TaskStatus, error)

InspectTask returns detailed status information for the referenced taskID.

func (*LibVirtDriverPlugin) PluginInfo

func (d *LibVirtDriverPlugin) PluginInfo() (*base.PluginInfoResponse, error)

PluginInfo returns information describing the plugin.

func (*LibVirtDriverPlugin) RecoverTask

func (d *LibVirtDriverPlugin) RecoverTask(handle *drivers.TaskHandle) error

RecoverTask recreates the in-memory state of a task from a TaskHandle.

func (*LibVirtDriverPlugin) SetConfig

func (d *LibVirtDriverPlugin) SetConfig(cfg *base.Config) error

SetConfig is called by the client to pass the configuration for the plugin.

func (*LibVirtDriverPlugin) Shutdown

func (d *LibVirtDriverPlugin) Shutdown(ctx context.Context) error

func (*LibVirtDriverPlugin) SignalTask

func (d *LibVirtDriverPlugin) SignalTask(taskID string, signal string) error

SignalTask forwards a signal to a task. This is an optional capability.

func (*LibVirtDriverPlugin) StartTask

StartTask returns a task handle and a driver network if necessary.

func (*LibVirtDriverPlugin) StopTask

func (d *LibVirtDriverPlugin) StopTask(taskID string, timeout time.Duration, signal string) error

StopTask stops a running task with the given signal and within the timeout window.

func (*LibVirtDriverPlugin) TaskConfigSchema

func (d *LibVirtDriverPlugin) TaskConfigSchema() (*hclspec.Spec, error)

TaskConfigSchema returns the HCL schema for the configuration of a task.

func (*LibVirtDriverPlugin) TaskEvents

func (d *LibVirtDriverPlugin) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

TaskEvents returns a channel that the plugin can use to emit task related events.

func (*LibVirtDriverPlugin) TaskStats

func (d *LibVirtDriverPlugin) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)

TaskStats returns a channel which the driver should send stats to at the given interval.

func (*LibVirtDriverPlugin) WaitTask

func (d *LibVirtDriverPlugin) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)

WaitTask returns a channel used to notify Nomad when a task exits.

type TaskConfig

type TaskConfig struct {
	Disk      []Disk      `codec:"disk"`
	Interface []Interface `codec:"interface"`
	Vnc       Vnc         `codec:"vnc"`
}

TaskConfig contains configuration information for a task that runs with this plugin

type TaskState

type TaskState struct {
	ReattachConfig *structs.ReattachConfig
	TaskConfig     *drivers.TaskConfig
	StartedAt      time.Time
}

type Vnc

type Vnc struct {
	Port      int `codec:"port"`
	Websocket int `codec:"websocket"`
}

Jump to

Keyboard shortcuts

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