pluginbase

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CorePluginConfig

type CorePluginConfig[ServerType any] struct {
	PluginID        string
	PluginType      pluginservicev1.PluginType
	ProtocolVersion string
	PluginServer    ServerType
}

CorePluginConfig is a struct that contains the core configuration for a plugin server.

type Server

type Server[ServerType any] struct {
	// contains filtered or unexported fields
}

Server is a plugin server.

func NewServer

func NewServer[ServerType any](
	corePluginConfig *CorePluginConfig[ServerType],
	registerPluginFunc func(s grpc.ServiceRegistrar, srv ServerType),
	pluginMetadata *pluginservicev1.PluginMetadata,
	pluginServiceClient pluginservicev1.ServiceClient,
	hostInfoContainer pluginutils.HostInfoContainer,
	opts ...ServerOption[ServerType],
) *Server[ServerType]

NewServer creates a new plugin server that is used as the base for all plugin type servers.

func (*Server[ServerType]) Serve

func (s *Server[ServerType]) Serve() (func(), error)

type ServerOption

type ServerOption[ServerType any] func(*Server[ServerType])

ServerOption is a function that configures a server.

func WithDebug

func WithDebug[ServerType any]() ServerOption[ServerType]

WithDebug is a server option that enables debug mode.

func WithListener

func WithListener[ServerType any](listener net.Listener) ServerOption[ServerType]

WithListener is a server option that sets the listener that the server should use.

func WithTCPPort

func WithTCPPort[ServerType any](port int) ServerOption[ServerType]

WithTCPPort is a server option that sets the TCP port.

func WithUnixSocket

func WithUnixSocket[ServerType any](path string) ServerOption[ServerType]

WithUnixSocket is a server option that sets the Unix socket path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL