connection

package
v1.28.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 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

Overview

Package connection represents a connected CNPG-i plugin

Package connection represents a connected CNPG-i plugin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	grpc.ClientConnInterface
	io.Closer
}

Handler represent a plugin connection

type Interface

type Interface interface {
	Name() string
	Metadata() Metadata

	LifecycleClient() lifecycle.OperatorLifecycleClient
	OperatorClient() operator.OperatorClient
	WALClient() wal.WALClient
	BackupClient() backup.BackupClient
	ReconcilerHooksClient() reconciler.ReconcilerHooksClient
	RestoreJobHooksClient() restore.RestoreJobHooksClient
	PostgresClient() postgresClient.PostgresClient
	MetricsClient() metrics.MetricsClient

	PluginCapabilities() []identity.PluginCapability_Service_Type
	OperatorCapabilities() []operator.OperatorCapability_RPC_Type
	WALCapabilities() []wal.WALCapability_RPC_Type
	LifecycleCapabilities() []*lifecycle.OperatorLifecycleCapabilities
	BackupCapabilities() []backup.BackupCapability_RPC_Type
	ReconcilerCapabilities() []reconciler.ReconcilerHooksCapability_Kind
	RestoreJobHooksCapabilities() []restore.RestoreJobHooksCapability_Kind
	PostgresCapabilities() []postgresClient.PostgresCapability_RPC_Type
	MetricsCapabilities() []metrics.MetricsCapability_RPC_Type

	Ping(ctx context.Context) error
	Close() error
}

Interface exposes the methods that allow the user to access to the features of a plugin

func LoadPlugin

func LoadPlugin(ctx context.Context, handler Handler) (Interface, error)

LoadPlugin loads the plugin connected over a certain collections, queries the metadata and prepares an active plugin connection interface

type Metadata

type Metadata struct {
	Name                       string
	Version                    string
	Capabilities               []string
	OperatorCapabilities       []string
	WALCapabilities            []string
	BackupCapabilities         []string
	RestoreJobHookCapabilities []string
	PostgresCapabilities       []string
}

Metadata expose the metadata as discovered from a plugin

type Protocol

type Protocol interface {
	Dial(ctx context.Context) (Handler, error)
}

Protocol represents a way to connect to a plugin

type ProtocolTCP

type ProtocolTCP struct {
	TLSConfig *tls.Config
	Address   string
}

ProtocolTCP is the implementation of the Protocol interface for plugins that are reachable via an mTLS TCP connection

func (*ProtocolTCP) Dial

func (p *ProtocolTCP) Dial(_ context.Context) (Handler, error)

Dial implements the protocol interface

type ProtocolUnix

type ProtocolUnix string

ProtocolUnix is for plugins that are reachable over a UNIX domain socket

func (ProtocolUnix) Dial

func (p ProtocolUnix) Dial(ctx context.Context) (Handler, error)

Dial implements the Protocol interface

Jump to

Keyboard shortcuts

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