pluginbase

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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