registry

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDriverNameExist is the error returned when trying to register a driver
	// which already exists in registry
	ErrDriverNameExist = errors.New("registry: duplicated driver name")

	// ErrDriverNotFound is the error returned when driver of a given name does
	// not exist in registry
	ErrDriverNotFound = errors.New("registry: driver not found")
)

Functions

func Register

func Register(driver DriverDef) error

Types

type ConfigFactory

type ConfigFactory func(config.MachineConfig) interface{}

ConfigFactory is a function that creates a driver config from MachineConfig

type DriverDef

type DriverDef struct {
	// Name of the machine driver. It has to be unique.
	Name string

	// BuiltIn indicates if the driver is builtin minikube binary, or the driver is
	// triggered through RPC.
	Builtin bool

	// ConfigCreator generate a raw driver object by minikube's machine config.
	ConfigCreator ConfigFactory

	// DriverCreator is the factory method that creates a machine driver instance.
	DriverCreator DriverFactory
}

DriverDef defines a machine driver metadata. It tells minikube how to initialize and load drivers.

func Driver

func Driver(name string) (DriverDef, error)

func ListDrivers

func ListDrivers() []DriverDef

func (DriverDef) String

func (d DriverDef) String() string

type DriverFactory

type DriverFactory func() drivers.Driver

DriverFactory is a function that load a byte stream and create a driver

type Registry

type Registry interface {
	// Register a driver in registry
	Register(driver DriverDef) error

	// Driver returns the registered driver from a given name
	Driver(name string) (DriverDef, error)

	// List
	List() []DriverDef
}

Registry contains all the supported driver definitions on the host

Jump to

Keyboard shortcuts

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