Documentation
¶
Overview ¶
Package config contains the functions to parse the plugin configuration
Index ¶
- type ConfigurationError
- type Plugin
- type PluginConfiguration
- func (config *PluginConfiguration) GetBarmanObjectKey() types.NamespacedName
- func (config *PluginConfiguration) GetRecoveryBarmanObjectKey() types.NamespacedName
- func (config *PluginConfiguration) GetReferredBarmanObjectsKey() []types.NamespacedName
- func (config *PluginConfiguration) GetReplicaSourceBarmanObjectKey() types.NamespacedName
- func (config *PluginConfiguration) Validate() error
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.
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