connection

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

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

	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

	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
}

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