binlogserver

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 27 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	SearchByTimestampCommand = "search_by_timestamp"
	SearchByGTIDCommand      = "search_by_gtid_set"
	SearchContainerName      = "binlog-search"
)
View Source
const BinlogServerBinary = "/usr/bin/binlog_server"

Variables

View Source
var (
	ErrTargetNotCovered = errors.New("pitr target is not covered by the binlog archive")
	ErrInvalidTarget    = errors.New("invalid pitr target")
)
View Source
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 GetBinlogServerPod(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) (*corev1.Pod, error)

func MatchLabels

func MatchLabels(cr *apiv1.PerconaServerMySQL) map[string]string

func Name

func ParseCipher added in v1.3.0

func ParseCipher(name string) (keySize int, mode string, err error)

func RestoreConfigSecretName added in v1.2.0

func RestoreConfigSecretName(cr *apiv1.PerconaServerMySQL, restore *apiv1.PerconaServerMySQLRestore) string

func RestoreName added in v1.2.0

func RestoreSpec added in v1.3.0

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

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 ConnectionTLS struct {
	CipherSuites string `json:"ciphersuites,omitempty"`
	Version      string `json:"version,omitempty"`
}

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 EncryptionConfig struct {
	Format string `json:"format,omitempty"`
	KekID  string `json:"kek_id,omitempty"`
	Cipher string `json:"cipher,omitempty"`
}

type FileDataEnvelope added in v1.3.0

type FileDataEnvelope struct {
	Cipher string `json:"cipher"`
	IVHex  string `json:"iv_hex"`
}

type FileKeyEnvelope added in v1.3.0

type FileKeyEnvelope struct {
	KekID   string `json:"kek_id"`
	DataHex string `json:"data_hex"`
	IVHex   string `json:"iv_hex"`
	TagHex  string `json:"tag_hex"`
}

type Key added in v1.3.0

type Key struct {
	Id      string `json:"id"`
	Cipher  string `json:"cipher"`
	DataHex string `json:"data_hex"`
}

type Keyring added in v1.3.0

type Keyring struct {
	Version int   `json:"version"`
	Keys    []Key `json:"keys"`
}

func DecodeKeyring added in v1.3.0

func DecodeKeyring(data []byte) (Keyring, error)

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.

func (Keyring) FindKey added in v1.3.0

func (k Keyring) FindKey(id string) *Key

func (Keyring) Validate added in v1.3.0

func (k Keyring) Validate() error

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 Logger

type Logger struct {
	Level string `json:"level,omitempty"`
	File  string `json:"file,omitempty"`
}

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 Rewrite added in v1.1.0

type Rewrite struct {
	BaseFileName string `json:"base_file_name,omitempty"`
	FileSize     string `json:"file_size,omitempty"`
}

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 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"`
}

Jump to

Keyboard shortcuts

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