exece2

package
v0.0.0-...-708b87c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAbsolutePath

func GetAbsolutePath(bin string) (string, error)

GetAbsolutePath returns the absolute path of the passed binary by resolving it in the path and following symlinks.

func NewPlugin

func NewPlugin(logger hclog.Logger) drivers.DriverPlugin

NewPlugin returns a new example driver plugin

Types

type Config

type Config struct {
	// TODO: create decoded plugin configuration struct
	//
	// This struct is the decoded version of the schema defined in the
	// configSpec variable above. It's used to convert the HCL configuration
	// passed by the Nomad agent into Go contructs.
	NoPivotRoot bool   `codec:"no_pivot_root"`
	Shell       string `codec:"shell"`
}

Config contains configuration information for the plugin

type Driver

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

func (*Driver) Capabilities

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

Capabilities returns the features supported by the driver.

func (*Driver) ConfigSchema

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

ConfigSchema returns the plugin configuration schema.

func (*Driver) DestroyTask

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

func (*Driver) ExecTask

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

func (*Driver) ExecTaskStreamingRaw

func (d *Driver) ExecTaskStreamingRaw(ctx context.Context,
	taskID string,
	command []string,
	tty bool,
	stream drivers.ExecTaskStream) error

func (*Driver) Fingerprint

func (d *Driver) 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 (*Driver) InspectTask

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

func (*Driver) PluginInfo

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

PluginInfo returns information describing the plugin.

func (*Driver) RecoverTask

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

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

func (*Driver) SetConfig

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

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

func (*Driver) SignalTask

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

func (*Driver) StartTask

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

func (*Driver) StopTask

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

func (*Driver) TaskConfigSchema

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

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

func (*Driver) TaskEvents

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

func (*Driver) TaskStats

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

func (*Driver) WaitTask

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

type TaskConfig

type TaskConfig struct {
	ArchiveStr string   `codec:"archiveStr"`
	Dir        string   `codec:"dir"`
	StartUp    string   `codec:"startUp"`
	Check      string   `codec:"check"`
	Stop       string   `codec:"stop"`
	Upgrade    string   `codec:"upgrade"`
	Command    string   `codec:"command"`
	Args       []string `codec:"args"`
}

TaskConfig is the driver configuration of a task within a job

type TaskState

type TaskState struct {
	ReattachConfig *pstructs.ReattachConfig
	TaskConfig     *drivers.TaskConfig
	Pid            int
	StartedAt      time.Time
}

TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the task state and handler during recovery.

Jump to

Keyboard shortcuts

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