Documentation
¶
Index ¶
- Variables
- type Device
- type DevicePlugin
- type RPCClient
- func (m *RPCClient) CreateDevice() (uint64, error)
- func (m *RPCClient) DevicePrint(ptr uint64) error
- func (m *RPCClient) DeviceSetValue(ptr uint64, value int32) error
- func (m *RPCClient) DeviceValue(ptr uint64) (int32, error)
- func (m *RPCClient) FreeDevice(ptr uint64) error
- func (m *RPCClient) GetDevice(ptr uint64, useJson bool) ([]byte, error)
- type RPCServer
- func (m *RPCServer) CreateDevice(_ interface{}, resp *uint64) error
- func (m *RPCServer) DevicePrint(ptr uint64, _ *struct{}) error
- func (m *RPCServer) DeviceSetValue(req *proto.DeviceSetValueRequest, _ *struct{}) error
- func (m *RPCServer) DeviceValue(ptr uint64, resp *int32) error
- func (m *RPCServer) FreeDevice(ptr uint64, _ *struct{}) error
- func (m *RPCServer) GetDevice(req *proto.GetDeviceRequest, resp *[]byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "DEVICE_PLUGIN",
MagicCookieValue: "device",
}
Handshake is a common handshake that is shared by plugin and host.
View Source
var PluginMap = map[string]plugin.Plugin{ "device": &DevicePlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device interface {
CreateDevice() (uint64, error)
FreeDevice(ptr uint64) error
GetDevice(ptr uint64, useJson bool) ([]byte, error)
DevicePrint(ptr uint64) error
DeviceValue(ptr uint64) (int32, error)
DeviceSetValue(ptr uint64, value int32) error
}
Device is the interface that we're exposing as a plugin.
type DevicePlugin ¶
type DevicePlugin struct {
plugin.NetRPCUnsupportedPlugin
// Concrete implementation, written in Go. This is only used for plugins
// that are written in Go.
Impl Device
}
This is the implementation of plugin.Plugin so we can serve/consume this. We also implement RPCPlugin so that this plugin can be served.
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func (*RPCClient) CreateDevice ¶
func (*RPCClient) DevicePrint ¶
func (*RPCClient) DeviceSetValue ¶
func (*RPCClient) FreeDevice ¶
type RPCServer ¶
type RPCServer struct {
Impl Device
}
func (*RPCServer) CreateDevice ¶
func (*RPCServer) DevicePrint ¶
func (*RPCServer) DeviceSetValue ¶
func (m *RPCServer) DeviceSetValue(req *proto.DeviceSetValueRequest, _ *struct{}) error
func (*RPCServer) FreeDevice ¶
Click to show internal directories.
Click to hide internal directories.