{"modulePath":"github.com/newstack-cloud/bluelink/libs/plugin-framework","version":"v0.17.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pluginbase\n\n## Types\n\n```go\ntype CorePluginConfig[ServerType any] struct {\n\tPluginID        string\n\tPluginType      pluginservicev1.PluginType\n\tProtocolVersion string\n\tPluginServer    ServerType\n}\n```\nCorePluginConfig is a struct that contains the core configuration for a plugin server.\n\n```go\ntype Server[ServerType any] struct {\n\t// contains filtered or unexported fields\n}\n```\nServer is a plugin server.\n\n```go\nfunc NewServer[ServerType any](\n\tcorePluginConfig *CorePluginConfig[ServerType],\n\tregisterPluginFunc func(s grpc.ServiceRegistrar, srv ServerType),\n\tpluginMetadata *pluginservicev1.PluginMetadata,\n\tpluginServiceClient pluginservicev1.ServiceClient,\n\thostInfoContainer pluginutils.HostInfoContainer,\n\topts ...ServerOption[ServerType],\n) *Server[ServerType]\n```\nNewServer creates a new plugin server that is used as the base for all plugin type servers.\n\n```go\nfunc (s *Server[ServerType]) Serve() (func(), error)\n```\n\n```go\ntype ServerOption[ServerType any] func(*Server[ServerType])\n```\nServerOption is a function that configures a server.\n\n```go\nfunc WithDebug[ServerType any]() ServerOption[ServerType]\n```\nWithDebug is a server option that enables debug mode.\n\n```go\nfunc WithListener[ServerType any](listener net.Listener) ServerOption[ServerType]\n```\nWithListener is a server option that sets the listener that the server should use.\n\n```go\nfunc WithTCPPort[ServerType any](port int) ServerOption[ServerType]\n```\nWithTCPPort is a server option that sets the TCP port.\n\n```go\nfunc WithUnixSocket[ServerType any](path string) ServerOption[ServerType]\n```\nWithUnixSocket is a server option that sets the Unix socket path.\n\n","path":"github.com/newstack-cloud/bluelink/libs/plugin-framework/pluginbase","name":"pluginbase","synopsis":"","isRedistributable":true}
