Documentation
¶
Index ¶
- Constants
- Variables
- func BinlogServerPodName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string
- func ConfigSecretName(cr *apiv1.PerconaServerMySQL) string
- func ConfigVolume(cr *apiv1.PerconaServerMySQL, configSecretName string) corev1.Volume
- func GetBinlogServerPod(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL, ...) (*corev1.Pod, error)
- func MatchLabels(cr *apiv1.PerconaServerMySQL) map[string]string
- func Name(cr *apiv1.PerconaServerMySQL) string
- func ParseCipher(name string) (keySize int, mode string, err error)
- func RestoreConfigSecretName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string
- func RestoreName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string
- func RestoreSpec(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) *apiv1.BinlogServerSpec
- func SearchArgs(restore *apiv1.PerconaServerMySQLRestore) (string, string, error)
- func SearchContainer(spec *apiv1.BinlogServerSpec, ...) corev1.Container
- func SearchVolumes(cr *apiv1.PerconaServerMySQL, spec *apiv1.BinlogServerSpec, ...) []corev1.Volume
- func StatefulSet(cr *apiv1.PerconaServerMySQL, spec *apiv1.BinlogServerSpec, ...) *appsv1.StatefulSet
- func ValidateTarget(ctx context.Context, st storage.Storage, ...) error
- type BinlogEntry
- type Configuration
- type Connection
- type ConnectionSSL
- type ConnectionTLS
- type Encryption
- type EncryptionConfig
- type FileDataEnvelope
- type FileKeyEnvelope
- type Key
- type Keyring
- type KeyringConfig
- type Logger
- type Replication
- type ReplicationMode
- type Rewrite
- type SearchResponse
- type Storage
Constants ¶
const ( AppName = "binlog-server" CredsMountPath = "/etc/mysql/mysql-users-secret" TLSMountPath = "/etc/mysql/mysql-tls-secret" BufferMountPath = "/var/lib/binlogsrv" ConfigVolumeName = "config" ConfigMountPath = "/etc/binlog_server/config" ConfigKey = "config.json" )
const ( SearchByTimestampCommand = "search_by_timestamp" SearchByGTIDCommand = "search_by_gtid_set" SearchContainerName = "binlog-search" )
const BinlogServerBinary = "/usr/bin/binlog_server"
Variables ¶
var ( ErrTargetNotCovered = errors.New("pitr target is not covered by the binlog archive") ErrInvalidTarget = errors.New("invalid pitr target") )
var ErrNoCredentials = errors.New("no binlog server credentials")
Functions ¶
func BinlogServerPodName ¶ added in v1.2.0
func BinlogServerPodName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string
func ConfigSecretName ¶
func ConfigSecretName(cr *apiv1.PerconaServerMySQL) string
func ConfigVolume ¶ added in v1.3.0
func ConfigVolume(cr *apiv1.PerconaServerMySQL, configSecretName string) corev1.Volume
func GetBinlogServerPod ¶ added in v1.2.0
func MatchLabels ¶
func MatchLabels(cr *apiv1.PerconaServerMySQL) map[string]string
func Name ¶
func Name(cr *apiv1.PerconaServerMySQL) string
func ParseCipher ¶ added in v1.3.0
func RestoreConfigSecretName ¶ added in v1.2.0
func RestoreConfigSecretName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string
func RestoreName ¶ added in v1.2.0
func RestoreName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string
func RestoreSpec ¶ added in v1.3.0
func RestoreSpec(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) *apiv1.BinlogServerSpec
func SearchArgs ¶ added in v1.3.0
func SearchArgs(restore *apiv1.PerconaServerMySQLRestore) (string, string, error)
func SearchContainer ¶ added in v1.3.0
func SearchContainer(spec *apiv1.BinlogServerSpec, subcommand, arg, outputVolumeName, outputMountPath, outputFile string) corev1.Container
func SearchVolumes ¶ added in v1.3.0
func SearchVolumes(cr *apiv1.PerconaServerMySQL, spec *apiv1.BinlogServerSpec, configSecretName string) []corev1.Volume
func StatefulSet ¶
func StatefulSet(cr *apiv1.PerconaServerMySQL, spec *apiv1.BinlogServerSpec, labels map[string]string, initImage, configHash, configSecretName string) *appsv1.StatefulSet
func ValidateTarget ¶ added in v1.3.0
func ValidateTarget(ctx context.Context, st storage.Storage, restore *apiv1.PerconaServerMySQLRestore) error
ValidateTarget rejects dates before the archive starts and GTIDs not covered by the archive.
Types ¶
type BinlogEntry ¶ added in v1.1.0
type BinlogEntry struct {
Name string `json:"name"`
URI string `json:"uri"`
Size int64 `json:"size,omitempty"`
PreviousGTIDs string `json:"previous_gtids,omitempty"`
AddedGTIDs string `json:"added_gtids,omitempty"`
MinTimestamp string `json:"min_timestamp,omitempty"`
MaxTimestamp string `json:"max_timestamp,omitempty"`
Encryption *Encryption `json:"encryption,omitempty"`
}
type Configuration ¶
type Configuration struct {
Logger Logger `json:"logger"`
Connection Connection `json:"connection"`
Replication Replication `json:"replication"`
Keyring *KeyringConfig `json:"keyring,omitempty"`
Storage Storage `json:"storage"`
}
func GetConfiguration ¶ added in v1.2.0
func GetConfiguration(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL, spec *apiv1.BinlogServerSpec) (Configuration, error)
type Connection ¶
type Connection struct {
Host string `json:"host,omitempty"`
Port int32 `json:"port,omitempty"`
User string `json:"user,omitempty"`
Password string `json:"password,omitempty"`
ConnectTimeout int32 `json:"connect_timeout,omitempty"`
ReadTimeout int32 `json:"read_timeout,omitempty"`
WriteTimeout int32 `json:"write_timeout,omitempty"`
SSL *ConnectionSSL `json:"ssl,omitempty"`
TLS *ConnectionTLS `json:"tls,omitempty"`
}
type ConnectionSSL ¶ added in v1.1.0
type ConnectionSSL struct {
Mode string `json:"mode,omitempty"`
CA string `json:"ca,omitempty"`
CAPath string `json:"capath,omitempty"`
CRL string `json:"crl,omitempty"`
CRLPath string `json:"crlpath,omitempty"`
Cert string `json:"cert,omitempty"`
Key string `json:"key,omitempty"`
Cipher string `json:"cipher,omitempty"`
}
type ConnectionTLS ¶ added in v1.1.0
type Encryption ¶ added in v1.3.0
type Encryption struct {
FileKeyEnvelope *FileKeyEnvelope `json:"file_key_envelope,omitempty"`
FileDataEnvelope *FileDataEnvelope `json:"file_data_envelope,omitempty"`
}
type EncryptionConfig ¶ added in v1.3.0
type FileDataEnvelope ¶ added in v1.3.0
type FileKeyEnvelope ¶ added in v1.3.0
type Keyring ¶ added in v1.3.0
func DecodeKeyring ¶ added in v1.3.0
DecodeKeyring parses keyring JSON and validates its contents. It rejects input that decodes without error but yields an unusable keyring, e.g. the JSON literal "null" or an object with no keys.
type KeyringConfig ¶ added in v1.3.0
type KeyringConfig struct {
URI string `json:"uri,omitempty"`
}
KeyringConfig is the top-level keyring section. It is needed both to encrypt new binlog files and to read already encrypted ones, so it is written even when storage encryption is disabled.
type Replication ¶
type Replication struct {
ServerID int32 `json:"server_id,omitempty"`
IdleTime int32 `json:"idle_time,omitempty"`
VerifyChecksum bool `json:"verify_checksum,omitempty"`
Mode ReplicationMode `json:"mode,omitempty"`
Rewrite Rewrite `json:"rewrite"`
}
type ReplicationMode ¶ added in v1.1.0
type ReplicationMode string
const (
ReplicationModeGTID ReplicationMode = "gtid"
)
type SearchResponse ¶ added in v1.1.0
type SearchResponse struct {
Version int `json:"version"`
Status string `json:"status"`
Result []BinlogEntry `json:"result"`
Message string `json:"message,omitempty"`
}
func SearchByGTID ¶ added in v1.1.0
func SearchByGTID(ctx context.Context, cl client.Client, cliCmd clientcmd.Client, cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore, gtidSet string) (*SearchResponse, error)
func SearchByTimestamp ¶ added in v1.1.0
func SearchByTimestamp(ctx context.Context, cl client.Client, cliCmd clientcmd.Client, cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore, timestamp string) (*SearchResponse, error)
func (*SearchResponse) Error ¶ added in v1.3.0
func (r *SearchResponse) Error() error
type Storage ¶
type Storage struct {
Backend string `json:"backend,omitempty"`
URI string `json:"uri,omitempty"`
FsBufferDirectory string `json:"fs_buffer_directory,omitempty"`
CheckpointSize string `json:"checkpoint_size,omitempty"`
CheckpointInterval string `json:"checkpoint_interval,omitempty"`
Encryption *EncryptionConfig `json:"encryption,omitempty"`
}