localbinary

package
v0.15.0-rancher118 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PluginEnvKey        = "MACHINE_PLUGIN_TOKEN"
	PluginEnvVal        = "42"
	PluginEnvDriverName = "MACHINE_PLUGIN_DRIVER_NAME"
	PluginUID           = "MACHINE_PLUGIN_UID"
	PluginGID           = "MACHINE_PLUGIN_GID"
)

Variables

View Source
var (
	CurrentBinaryIsDockerMachine = false
	CoreDrivers                  = []string{
		"amazonec2",
		"azure",
		"digitalocean",
		"exoscale",
		"generic",
		"google",
		"hyperv",
		"none",
		"openstack",
		"rackspace",
		"softlayer",
		"virtualbox",
		"vmwarefusion",
		"vmwarevcloudair",
		"vmwarevsphere",
		"pod",
		"noop",
	}
)

Functions

This section is empty.

Types

type DriverPlugin

type DriverPlugin interface {
	PluginServer
	PluginStreamer
}

DriverPlugin interface wraps the underlying mechanics of starting a driver plugin server and then figuring out where it can be dialed.

type ErrPluginBinaryNotFound

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

func (ErrPluginBinaryNotFound) Error

func (e ErrPluginBinaryNotFound) Error() string

type Executor added in v0.5.1

type Executor struct {
	DriverName string
	// contains filtered or unexported fields
}

func (*Executor) Close added in v0.5.1

func (lbe *Executor) Close() error

func (*Executor) Start added in v0.5.1

func (lbe *Executor) Start() (*bufio.Scanner, *bufio.Scanner, error)

type McnBinaryExecutor

type McnBinaryExecutor interface {
	// Execute the driver plugin.  Returns scanners for plugin binary
	// stdout and stderr.
	Start() (*bufio.Scanner, *bufio.Scanner, error)

	// Stop reading from the plugins in question.
	Close() error
}

type Plugin added in v0.5.1

type Plugin struct {
	Executor    McnBinaryExecutor
	Addr        string
	MachineName string
	// contains filtered or unexported fields
}

func NewPlugin added in v0.5.1

func NewPlugin(driverName string) (*Plugin, error)

NewPlugin creates a Plugin for the specified driver.

The `driverName` can be either a simple name or an absolute path to the driver:

  • If `driverName` is a simple name, "docker-machine-driver-" is prepended to it, and the executable is searched for in the directories listed in the PATH environment variable.
  • If `driverName` is an absolute path, the executable is searched for at that specific location.

func (*Plugin) Address added in v0.5.1

func (lbp *Plugin) Address() (string, error)

func (*Plugin) AttachStream added in v0.5.1

func (lbp *Plugin) AttachStream(scanner *bufio.Scanner) <-chan string

func (*Plugin) Close added in v0.5.1

func (lbp *Plugin) Close() error

func (*Plugin) Serve added in v0.5.1

func (lbp *Plugin) Serve() error

type PluginServer

type PluginServer interface {
	// Get the address where the plugin server is listening.
	Address() (string, error)

	// Serve kicks off the plugin server.
	Serve() error

	// Close shuts down the initialized server.
	Close() error
}

type PluginStreamer

type PluginStreamer interface {
	// Return a channel for receiving the output of the stream line by
	// line.
	//
	// It happens to be the case that we do this all inside of the main
	// plugin struct today, but that may not be the case forever.
	AttachStream(*bufio.Scanner) <-chan string
}

Jump to

Keyboard shortcuts

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