 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceInfo ¶
type DeviceInfo struct {
	State  string
	Nodes  []pluginapi.DeviceSpec
	Mounts []pluginapi.Mount
	Envs   map[string]string
}
    DeviceInfo contains information about device maintained by Device Plugin
type DeviceTree ¶
type DeviceTree map[string]map[string]DeviceInfo
DeviceTree contains a tree-like structure of device type -> device ID -> device info.
func NewDeviceTree ¶
func NewDeviceTree() DeviceTree
NewDeviceTree creates an instance of DeviceTree
func (DeviceTree) AddDevice ¶
func (tree DeviceTree) AddDevice(devType, id string, info DeviceInfo)
AddDevice adds device info to DeviceTree.
type Manager ¶
type Manager struct {
	// contains filtered or unexported fields
}
    Manager manages life cycle of device plugins and handles the scan results received from them.
func NewManager ¶
NewManager creates a new instance of Manager
type Notifier ¶
type Notifier interface {
	// Notify notifies manager with a device tree constructed by device
	// plugin during scanning process.
	Notify(DeviceTree)
}
    Notifier receives updates from Scanner, detects changes and sends the detected changes to a channel given by the creator of a Notifier object.
type PostAllocator ¶
type PostAllocator interface {
	// PostAllocate modifies responses returned by Allocate() by e.g.
	// adding annotations consumed by CRI hooks to the responses.
	PostAllocate(*pluginapi.AllocateResponse) error
}
    PostAllocator is an optional interface implemented by device plugins.
type Scanner ¶
type Scanner interface {
	// Scan scans the host for devices and sends all found devices to
	// a Notifier instance. It's called only once for every device plugin by
	// Manager in a goroutine and operates in an infinite loop.
	Scan(Notifier) error
}
    Scanner serves as an interface between Manager and a device plugin.