Documentation ¶
Index ¶
- Constants
- Variables
- func CopyFile(src, dst string) error
- func GetBackupPass() string
- func GetBackupUser() string
- func GetClusterName() string
- func GetExporterPass() string
- func GetExporterUser() string
- func GetHostFor(id int) string
- func GetHostname() string
- func GetInitBucket() string
- func GetMasterHost() string
- func GetMySQLConnectionString() (string, error)
- func GetNamespace() string
- func GetOrcPass() string
- func GetOrcUser() string
- func GetReplPass() string
- func GetReplUser() string
- func GetServerID() int
- func GetServiceName() string
- func MaxClients(h http.Handler, n int) http.Handler
- func NodeRole() string
- func ReadPurgedGTID() (string, error)
- func RequestABackup(host, endpoint string) (io.Reader, error)
- func RunQuery(q string, args ...interface{}) error
- func ShouldBootstrapNode() bool
Constants ¶
const ( // RcloneConfigFile represents the path to the file that contains rclon // configs. This path should be the same as defined in docker entrypoint // script from mysql-operator-sidecar/docker-entrypoint.sh. /etc/rclone.conf RcloneConfigFile = "/etc/rclone.conf" )
Variables ¶
var ( // MysqlPort represents port on which mysql works MysqlPort = strconv.Itoa(constants.MysqlPort) // ConfigDir is the mysql configs path, /etc/mysql ConfigDir = constants.ConfVolumeMountPath // ConfDPath is /etc/mysql/conf.d ConfDPath = constants.ConfDPath // MountConfigDir is the mounted configs that needs processing MountConfigDir = constants.ConfMapVolumeMountPath // DataDir is the mysql data. /var/lib/mysql DataDir = constants.DataVolumeMountPath // ToolsDbName is the name of the tools table ToolsDbName = constants.HelperDbName // ToolsInitTableName is the name of the init table ToolsInitTableName = "init" // UtilityUser is the name of the percona utility user. UtilityUser = "sys_utility_sidecar" // OrcTopologyDir contains the path where the secret with orc credentials is // mounted. OrcTopologyDir = constants.OrcTopologyDir // ServerPort http server port ServerPort = constants.SidecarServerPort // ServerProbeEndpoint is the http server endpoint for probe ServerProbeEndpoint = constants.SidecarServerProbePath // ServerBackupEndpoint is the http server endpoint for backups ServerBackupEndpoint = "/xbackup" )
Functions ¶
func CopyFile ¶
CopyFile the src file to dst. Any existing file will be overwritten and will not copy file attributes. nolint: gosec
func GetBackupPass ¶
func GetBackupPass() string
GetBackupPass returns the basic auth credentials to access backup
func GetBackupUser ¶
func GetBackupUser() string
GetBackupUser returns the basic auth credentials to access backup
func GetClusterName ¶
func GetClusterName() string
GetClusterName returns the mysql cluster name from env MY_CLUSTER_NAME
func GetExporterPass ¶
func GetExporterPass() string
GetExporterPass returns the replication password from env variable MYSQL_METRICS_EXPORTER_PASSWORD
func GetExporterUser ¶
func GetExporterUser() string
GetExporterUser returns the replication user name from env variable MYSQL_METRICS_EXPORTER_USER
func GetInitBucket ¶
func GetInitBucket() string
GetInitBucket returns the bucket uri from env variable INIT_BUCKET_URI
func GetMySQLConnectionString ¶
GetMySQLConnectionString returns the mysql DSN
func GetNamespace ¶
func GetNamespace() string
GetNamespace returns the namespace of the pod from env MY_NAMESPACE
func GetOrcPass ¶
func GetOrcPass() string
GetOrcPass returns the orchestrator topology password from env variable MYSQL_ORC_TOPOLOGY_PASSWORD
func GetOrcUser ¶
func GetOrcUser() string
GetOrcUser returns the orchestrator topology user from env variable MYSQL_ORC_TOPOLOGY_USER
func GetReplPass ¶
func GetReplPass() string
GetReplPass returns the replication password from env variable MYSQL_REPLICATION_PASSWORD
func GetReplUser ¶
func GetReplUser() string
GetReplUser returns the replication user name from env variable MYSQL_REPLICATION_USER
func GetServiceName ¶
func GetServiceName() string
GetServiceName returns the headless service name from env MY_SERVICE_NAME
func MaxClients ¶
MaxClients limit an http endpoint to allow just n max concurrent connections
func ReadPurgedGTID ¶ added in v0.2.3
ReadPurgedGTID returns the GTID from xtrabackup_binlog_info file
func RequestABackup ¶
RequestABackup connects to specified host and endpoint and gets the backup
func ShouldBootstrapNode ¶ added in v0.2.3
func ShouldBootstrapNode() bool
ShouldBootstrapNode checks if the mysql data is at the first initialization
Types ¶
This section is empty.