Documentation ¶
Index ¶
- type Client
- type ClientHandler
- type DevicePlugin
- type RegistrationHandler
- type Server
- type Stub
- func (m *Stub) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (m *Stub) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (m *Stub) GetInfo(ctx context.Context, req *watcherapi.InfoRequest) (*watcherapi.PluginInfo, error)
- func (m *Stub) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (m *Stub) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (m *Stub) NotifyRegistrationStatus(ctx context.Context, status *watcherapi.RegistrationStatus) (*watcherapi.RegistrationStatusResponse, error)
- func (m *Stub) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *Stub) Register(kubeletEndpoint, resourceName string, pluginSockDir string) error
- func (m *Stub) SetAllocFunc(f stubAllocFunc)
- func (m *Stub) SetGetPreferredAllocFunc(f stubGetPreferredAllocFunc)
- func (m *Stub) Start() error
- func (m *Stub) Stop() error
- func (m *Stub) Update(devs []*pluginapi.Device)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewPluginClient ¶
func NewPluginClient(r string, socketPath string, h ClientHandler) Client
type ClientHandler ¶
type ClientHandler interface { PluginConnected(string, DevicePlugin) error PluginDisconnected(string) PluginListAndWatchReceiver(string, *api.ListAndWatchResponse) }
type DevicePlugin ¶
type DevicePlugin interface { Api() api.DevicePluginClient Resource() string SocketPath() string }
type RegistrationHandler ¶
type Server ¶
type Server interface { cache.PluginHandler Start() error Stop() error SocketPath() string }
func NewServer ¶
func NewServer(socketPath string, rh RegistrationHandler, ch ClientHandler) (Server, error)
type Stub ¶
type Stub struct {
// contains filtered or unexported fields
}
Stub implementation for DevicePlugin.
func NewDevicePluginStub ¶
func NewDevicePluginStub(devs []*pluginapi.Device, socket string, name string, preStartContainerFlag bool, getPreferredAllocationFlag bool) *Stub
NewDevicePluginStub returns an initialized DevicePlugin Stub.
func (*Stub) Allocate ¶
func (m *Stub) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
Allocate does a mock allocation
func (*Stub) GetDevicePluginOptions ¶
func (m *Stub) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
GetDevicePluginOptions returns DevicePluginOptions settings for the device plugin.
func (*Stub) GetInfo ¶
func (m *Stub) GetInfo(ctx context.Context, req *watcherapi.InfoRequest) (*watcherapi.PluginInfo, error)
GetInfo is the RPC which return pluginInfo
func (*Stub) GetPreferredAllocation ¶
func (m *Stub) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
GetPreferredAllocation gets the preferred allocation from a set of available devices
func (*Stub) ListAndWatch ¶
ListAndWatch lists devices and update that list according to the Update call
func (*Stub) NotifyRegistrationStatus ¶
func (m *Stub) NotifyRegistrationStatus(ctx context.Context, status *watcherapi.RegistrationStatus) (*watcherapi.RegistrationStatusResponse, error)
NotifyRegistrationStatus receives the registration notification from watcher
func (*Stub) PreStartContainer ¶
func (m *Stub) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer resets the devices received
func (*Stub) Register ¶
Register registers the device plugin for the given resourceName with Kubelet.
func (*Stub) SetAllocFunc ¶
func (m *Stub) SetAllocFunc(f stubAllocFunc)
SetAllocFunc sets allocFunc of the device plugin
func (*Stub) SetGetPreferredAllocFunc ¶
func (m *Stub) SetGetPreferredAllocFunc(f stubGetPreferredAllocFunc)
SetGetPreferredAllocFunc sets allocFunc of the device plugin