proxysqlutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	// contains filtered or unexported fields
}

Admin wraps redis cluster admin logic

func (*Admin) Close

func (a *Admin) Close()

Close used to close all possible resources instanciate by the Admin

func (*Admin) Connections

func (a *Admin) Connections() mysqlutil.IAdminConnections

Connections returns the connection map of all clients

func (*Admin) GetRuntimeMysqlReplicationHostGroup

func (a *Admin) GetRuntimeMysqlReplicationHostGroup(ctx context.Context, addr string, writerHostGroupId int) (*ReplicationHostgroup, error)

func (*Admin) GetRuntimeMysqlReplicationServers

func (a *Admin) GetRuntimeMysqlReplicationServers(ctx context.Context, addr string) (Servers, error)

func (*Admin) GetRuntimeMysqlUsers

func (a *Admin) GetRuntimeMysqlUsers(ctx context.Context, addr string) (mysqlutil.Users, error)

func (*Admin) SyncMysqlReplicationHostGroup

func (a *Admin) SyncMysqlReplicationHostGroup(ctx context.Context, addr string, hostgroup *ReplicationHostgroup) error

func (*Admin) SyncMysqlReplicationServers

func (a *Admin) SyncMysqlReplicationServers(ctx context.Context, addr string, expectedServers, foundServers Servers) error

func (*Admin) SyncMysqlUsers

func (a *Admin) SyncMysqlUsers(ctx context.Context, addr string, defaultHostGroup, maxConnections int, expectedUsers, foundUsers mysqlutil.Users) error

func (*Admin) SyncMysqlVersion

func (a *Admin) SyncMysqlVersion(ctx context.Context, addr, version string) error

type IAdmin

type IAdmin interface {
	// Connections returns the connection map of all clients
	Connections() mysqlutil.IAdminConnections

	// Close the admin connections
	Close()

	// SyncMysqlUsers sync users to proxysql
	SyncMysqlUsers(ctx context.Context, addr string, defaultHostGroup, maxConnections int, expectedUsers, foundUsers mysqlutil.Users) error

	// SyncMysqlReplicationHostGroup sync server to proxysql
	SyncMysqlReplicationHostGroup(ctx context.Context, addr string, hostgroup *ReplicationHostgroup) error

	// SyncMysqlReplicationServers sync hostGroup to proxysql
	SyncMysqlReplicationServers(ctx context.Context, addr string, expectedServers, foundServers Servers) error

	// GetRuntimeMysqlUsers get runtime user from proxysql
	GetRuntimeMysqlUsers(ctx context.Context, addr string) (mysqlutil.Users, error)

	// GetRuntimeMysqlReplicationHostGroup get runtime hostGroup from proxysql
	GetRuntimeMysqlReplicationHostGroup(ctx context.Context, addr string, writerHostGroup int) (*ReplicationHostgroup, error)

	// GetRuntimeMysqlReplicationServers get runtime server from proxysql
	GetRuntimeMysqlReplicationServers(ctx context.Context, addr string) (Servers, error)

	// SyncMysqlVersion sync the mysql-server_version variable
	SyncMysqlVersion(ctx context.Context, addr, version string) error
}

IAdmin proxysql admin interface

func NewAdmin

func NewAdmin(addrs []string, options *mysqlutil.AdminOptions, log logr.Logger) IAdmin

NewAdmin returns new AdminInterface instance at the same time it connects to all Redis ReplicationNodes thanks to the addrs list

type ReplicationHostgroup

type ReplicationHostgroup struct {
	WriterHostGroupId int
	ReaderHostGroupId int
	CheckType         string
	Comment           string
}

type Server

type Server struct {
	HostGroupId    int
	Hostname       string
	Port           int
	MaxConnections int
}

type Servers

type Servers map[string]*Server

Jump to

Keyboard shortcuts

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