Documentation
¶
Overview ¶
Package grpc provides gRPC-based plugin client implementation. It handles communication with plugins using gRPC protocol, including process management, socket file handling, and request/response conversion.
Package plugininterface provides utility functions for plugin implementations. It includes helper functions for type conversion and data manipulation.
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 represents a gRPC plugin client. It manages the lifecycle of a plugin process and handles communication via gRPC.
func NewClient ¶
NewClient creates a new gRPC plugin client. It sets up a temporary directory for the socket file and starts the plugin process. The pluginPath parameter specifies the path to the plugin executable. Returns a new Client instance and an error if initialization fails.
func (*Client) Close ¶
Close terminates the plugin process and cleans up resources. It sends a shutdown request to the plugin and waits for it to terminate. The context can be used for cancellation and timeout control. Returns an error if cleanup fails.
func (*Client) GetMetadata ¶
func (c *Client) GetMetadata(ctx context.Context, entry *model.DomainEntry, dehydratedConfig *dehydrated.Config) (map[string]any, error)
GetMetadata retrieves metadata for a domain entry from the plugin. It converts the domain entry to protobuf format and sends it to the plugin. The context can be used for cancellation and timeout control. Returns a map of metadata key-value pairs and an error if the operation fails.
func (*Client) Initialize ¶
Initialize initializes the plugin with the provided configuration. It converts the configuration to protobuf format and sends it to the plugin. The context can be used for cancellation and timeout control. Returns an error if initialization fails.