lifecycle

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 13 Imported by: 2 modules, 2 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

Overview

Package lifecycle exposes plugin identity, declared capabilities, and process readiness over gRPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the generated gRPC client for the PluginLifecycle service.

func NewClient

NewClient creates a properly initialized lifecycle Client.

func (*Client) BindHostServices added in v0.13.0

func (c *Client) BindHostServices(ctx context.Context, brokerID uint32, version uint32) (uint32, error)

BindHostServices negotiates the callback service for this plugin process.

func (*Client) GetCapabilities

func (c *Client) GetCapabilities(ctx context.Context) (*lifecyclepb.GetCapabilitiesResponse, error)

GetCapabilities returns declared transports, not authorization or per-resource operation support.

func (*Client) GetInfo

func (c *Client) GetInfo(ctx context.Context) (*lifecyclepb.GetInfoResponse, error)

GetInfo returns plugin identity and protocol metadata, or an error for an uninitialized client.

func (*Client) GetProfilingStatus added in v0.11.0

func (c *Client) GetProfilingStatus(ctx context.Context) (*lifecyclepb.ProfilingStatusResponse, error)

GetProfilingStatus queries the profiler owned by the plugin process.

func (*Client) HealthCheck

func (c *Client) HealthCheck(ctx context.Context) (*lifecyclepb.HealthCheckResponse, error)

HealthCheck queries process serving status, not native connection health.

func (*Client) ServeHostConnections added in v0.13.0

func (c *Client) ServeHostConnections(ctx context.Context, service hostconnections.Service) (stop func(), err error)

ServeHostConnections binds a callback server to this plugin process. The caller must invoke stop when the process or its grants retire. The context bounds binding only; stop owns the accepted server's lifetime. A binding error can follow remote acceptance. Retire the process on error instead of retrying a binding whose outcome is uncertain.

type Plugin

type Plugin struct {
	plugin.Plugin

	// Impl is the concrete server implementation (set on plugin side).
	Impl *Server
}

Plugin implements the go-plugin.Plugin interface for the lifecycle service. On the server side it registers the Server implementation. On the client side it returns a Client that wraps the gRPC stub.

func (*Plugin) GRPCClient

func (p *Plugin) GRPCClient(
	_ context.Context,
	broker *plugin.GRPCBroker,
	c *grpc.ClientConn,
) (any, error)

GRPCClient returns a lifecycle client using the supplied connection.

func (*Plugin) GRPCServer

func (p *Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer installs the lifecycle server supplied in Impl.

type Server

type Server struct {
	lifecyclepb.UnimplementedPluginLifecycleServer

	PluginID           string
	Version            string
	SDKProtocolVersion int32
	Capabilities       []string
	ProfilingStatus    func() profiling.Status
	HostConnections    *hostconnections.Binding
	// contains filtered or unexported fields
}

Server implements the PluginLifecycle gRPC service. It is auto-populated by sdk.Plugin.Serve() — plugin authors never touch it.

func (*Server) BindHostServices added in v0.13.0

BindHostServices dials and binds the host callback exactly once.

func (*Server) GetCapabilities

GetCapabilities returns the registered capability snapshot. Direct callers must not mutate its slice.

func (*Server) GetInfo

GetInfo returns the process metadata captured at lifecycle registration.

func (*Server) GetProfilingStatus added in v0.11.0

func (s *Server) GetProfilingStatus(_ context.Context, _ *emptypb.Empty) (*lifecyclepb.ProfilingStatusResponse, error)

GetProfilingStatus reports current listener facts and this process's PID.

func (*Server) HealthCheck

HealthCheck reports that this plugin process serves RPCs; it does not probe providers.

Jump to

Keyboard shortcuts

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