lifecycle

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0 Imports: 8 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) 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.

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,
	_ *plugin.GRPCBroker,
	c *grpc.ClientConn,
) (any, error)

GRPCClient returns a lifecycle client using the supplied connection.

func (*Plugin) GRPCServer

func (p *Plugin) GRPCServer(_ *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
}

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

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