config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config contains the functions to parse the plugin configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationError

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

ConfigurationError represents a mistake in the plugin configuration

func NewConfigurationError

func NewConfigurationError() *ConfigurationError

NewConfigurationError creates a new empty configuration error

func (*ConfigurationError) Error

func (e *ConfigurationError) Error() string

Error implements the error interface

func (*ConfigurationError) IsEmpty

func (e *ConfigurationError) IsEmpty() bool

IsEmpty returns true if there's no error messages

func (*ConfigurationError) WithMessage

func (e *ConfigurationError) WithMessage(msg string) *ConfigurationError

WithMessage adds a new error message to a potentially empty ConfigurationError

type Plugin

type Plugin struct {
	Cluster *cnpgv1.Cluster
	// Parameters are the configuration parameters of this plugin
	Parameters  map[string]string
	PluginIndex int
}

Plugin represents a plugin with its associated cluster and parameters.

func NewPlugin

func NewPlugin(cluster cnpgv1.Cluster, pluginName string) *Plugin

NewPlugin creates a new Plugin instance for the given cluster and plugin name.

type PluginConfiguration

type PluginConfiguration struct {
	Cluster *cnpgv1.Cluster

	PgbackrestObjectName string
	Stanza               string

	RecoveryPgbackrestObjectName string
	RecoveryStanza               string

	ReplicaSourcePgbackrestObjectName string
	ReplicaSourceStanza               string
}

PluginConfiguration is the configuration of the plugin

func NewFromCluster

func NewFromCluster(cluster *cnpgv1.Cluster) *PluginConfiguration

NewFromCluster extracts the configuration from the cluster

func NewFromClusterJSON

func NewFromClusterJSON(clusterJSON []byte) (*PluginConfiguration, error)

NewFromClusterJSON decodes a JSON representation of a cluster.

func (*PluginConfiguration) GetArchiveObjectKey

func (config *PluginConfiguration) GetArchiveObjectKey() types.NamespacedName

GetArchiveObjectKey gets the namespaced name of the pgbackrest archive object

func (*PluginConfiguration) GetRecoveryArchiveObjectKey

func (config *PluginConfiguration) GetRecoveryArchiveObjectKey() types.NamespacedName

GetRecoveryArchiveObjectKey gets the namespaced name of the recovery pgbackrest archive object

func (*PluginConfiguration) GetReferredArchiveObjectsKey

func (config *PluginConfiguration) GetReferredArchiveObjectsKey() []types.NamespacedName

GetReferredArchiveObjectsKey gets the list of pgbackrest archive objects referred by this plugin configuration

func (*PluginConfiguration) GetReplicaSourceArchiveObjectKey

func (config *PluginConfiguration) GetReplicaSourceArchiveObjectKey() types.NamespacedName

GetReplicaSourceArchiveObjectKey gets the namespaced name of the replica source pgbackrest archive object

func (*PluginConfiguration) Validate

func (config *PluginConfiguration) Validate() error

Validate checks if the pgbackrestObjectName is set

Jump to

Keyboard shortcuts

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