Documentation
¶
Overview ¶
Package config contains the functions to parse the plugin configuration
Index ¶
- type ConfigurationError
- type Plugin
- type PluginConfiguration
- func (config *PluginConfiguration) GetArchiveObjectKey() types.NamespacedName
- func (config *PluginConfiguration) GetRecoveryArchiveObjectKey() types.NamespacedName
- func (config *PluginConfiguration) GetReferredArchiveObjectsKey() []types.NamespacedName
- func (config *PluginConfiguration) GetReplicaSourceArchiveObjectKey() 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
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