config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 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

	BarmanObjectName string
	ServerName       string

	RecoveryBarmanObjectName string
	RecoveryServerName       string

	ReplicaSourceBarmanObjectName string
	ReplicaSourceServerName       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) GetBarmanObjectKey

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

GetBarmanObjectKey gets the namespaced name of the barman object

func (*PluginConfiguration) GetRecoveryBarmanObjectKey

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

GetRecoveryBarmanObjectKey gets the namespaced name of the recovery barman object

func (*PluginConfiguration) GetReferredBarmanObjectsKey

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

GetReferredBarmanObjectsKey gets the list of barman objects referred by this plugin configuration

func (*PluginConfiguration) GetReplicaSourceBarmanObjectKey

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

GetReplicaSourceBarmanObjectKey gets the namespaced name of the replica source barman object

func (*PluginConfiguration) Validate

func (config *PluginConfiguration) Validate() error

Validate checks if the barmanObjectName is set

Jump to

Keyboard shortcuts

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