Documentation
¶
Index ¶
- Constants
- func DeserializeObject(data []byte, typeName string) (interface{}, error)
- func Load(opt PluginLoadOptions, cs store.CatalogStore) (interface{}, error)
- func RegisterType(value interface{})
- func SerializeObject(obj interface{}) ([]byte, string, error)
- func Serve(p Plugin, opt PluginServeOptions) error
- type Plugin
- type PluginLoadOptions
- type PluginResponse
- type PluginServeOptions
- type TypeRegistry
Constants ¶
View Source
const ( PLUGIN_DISCOVERY_ADDRESS = "PLUGIN_DISCOVERY_ADDRESS" PLUGIN_SOCKET_TYPE = "PLUGIN_SOCKET_TYPE" PLUGIN_MIN_PORT = "PLUGIN_MIN_PORT" PLUGIN_MAX_PORT = "PLUGIN_MAX_PORT" MIN_PORT = 10000 MAX_PORT = 15000 SOCKET_TYPE_TCP = "tcp" SOCKET_TYPE_UNIX = "unix" )
Variables ¶
This section is empty.
Functions ¶
func DeserializeObject ¶ added in v0.2.0
DeserializeObject reconstructs an object from bytes
func Load ¶
func Load(opt PluginLoadOptions, cs store.CatalogStore) (interface{}, error)
Load loads a plugin either from a remote address or a local process. If the address is provided, it connects to the remote plugin using gRPC. If not, it starts the plugin in a subprocess and returns the client.
func RegisterType ¶ added in v0.2.0
func RegisterType(value interface{})
RegisterType registers a type with the global registry
func SerializeObject ¶ added in v0.2.0
SerializeObject serializes an object to bytes
func Serve ¶
func Serve(p Plugin, opt PluginServeOptions) error
Serve starts a gRPC server for the plugin and listens on the provided address. If host is empty, it binds to all interfaces but returns the first non-loopback local IP address for the client and discovery server.
Types ¶
type PluginLoadOptions ¶
type PluginResponse ¶
type PluginServeOptions ¶
type TypeRegistry ¶ added in v0.2.0
type TypeRegistry struct {
// contains filtered or unexported fields
}
TypeRegistry maintains a mapping of type names to their concrete types
Click to show internal directories.
Click to hide internal directories.