Documentation ¶
Index ¶
- Constants
- func LoadAdminVariablesToRuntime(db *sql.DB) error
- func LoadMySQLVariablesToRuntime(db *sql.DB) error
- func LoadQueryRulesToRuntime(db *sql.DB) error
- func LoadSchedulerToRuntime(db *sql.DB) error
- func LoadServerToRuntime(db *sql.DB) error
- func LoadUserToRuntime(db *sql.DB) error
- func ProxyFlushLogs(db *sql.DB) error
- func ProxyKill(db *sql.DB) error
- func ProxyPause(db *sql.DB) error
- func ProxyReadOnly(db *sql.DB) error
- func ProxyReadWrite(db *sql.DB) error
- func ProxyRestart(db *sql.DB) error
- func ProxyResume(db *sql.DB) error
- func ProxyShutdown(db *sql.DB) error
- func ProxyStart(db *sql.DB) error
- func ProxyStop(db *sql.DB) error
- func SaveAdminVariablesToDisk(db *sql.DB) error
- func SaveMySQLVariablesToDisk(db *sql.DB) error
- func SaveQueryRulesToDisk(db *sql.DB) error
- func SaveSchedulerToDisk(db *sql.DB) error
- func SaveServerToDisk(db *sql.DB) error
- func SaveUserToDisk(db *sql.DB) error
- func UpdateOneConfig(db *sql.DB, var_name string, var_value string) error
- type Conn
- type PsStatus
- type QueryRules
- func (qr *QueryRules) AddOneQr(db *sql.DB) error
- func (qr *QueryRules) DeleteOneQr(db *sql.DB) error
- func (qr *QueryRules) SetProxyPort(proxy_port string)
- func (qr *QueryRules) SetQrActive(active uint64)
- func (qr *QueryRules) SetQrApply(apply uint64)
- func (qr *QueryRules) SetQrCacheTTL(cache_ttl string)
- func (qr *QueryRules) SetQrClientAddr(client_addr string)
- func (qr *QueryRules) SetQrDelay(delay string)
- func (qr *QueryRules) SetQrDestHostGroup(destination_hostgroup string)
- func (qr *QueryRules) SetQrDigest(digest string)
- func (qr *QueryRules) SetQrErrorMsg(error_msg string)
- func (qr *QueryRules) SetQrFlagIN(flag_in uint64)
- func (qr *QueryRules) SetQrFlagOut(flag_out string)
- func (qr *QueryRules) SetQrLog(log string)
- func (qr *QueryRules) SetQrMatchDigest(match_digest string)
- func (qr *QueryRules) SetQrMatchPattern(match_pattern string)
- func (qr *QueryRules) SetQrMirrorFlagOUT(mirror_flagout string)
- func (qr *QueryRules) SetQrMirrorHostgroup(mirror_hostgroup string)
- func (qr *QueryRules) SetQrNegateMatchPattern(negate_match_pattern uint64)
- func (qr *QueryRules) SetQrProxyAddr(proxy_addr string)
- func (qr *QueryRules) SetQrReconnect(reconnect string)
- func (qr *QueryRules) SetQrReplacePattern(replace_pattern string)
- func (qr *QueryRules) SetQrRetries(retries string)
- func (qr *QueryRules) SetQrRuleid(rule_id uint64)
- func (qr *QueryRules) SetQrSchemaname(schema_name string)
- func (qr *QueryRules) SetQrTimeOut(timeout string)
- func (qr *QueryRules) UpdateOneQrInfo(db *sql.DB) error
- type ReplicationHostgroup
- func (rhg *ReplicationHostgroup) AddOneRHG(db *sql.DB) error
- func (rhg *ReplicationHostgroup) DeleteOneRHG(db *sql.DB) error
- func (rhg *ReplicationHostgroup) SetComment(comment string)
- func (rhg *ReplicationHostgroup) SetReaderHostGroup(reader uint64)
- func (rhg *ReplicationHostgroup) SetWriterHostGroup(writer uint64)
- func (rhg *ReplicationHostgroup) UpdateOneRHG(db *sql.DB) error
- type Schedulers
- func (schld *Schedulers) AddOneScheduler(db *sql.DB) error
- func (schld *Schedulers) DeleteOneScheduler(db *sql.DB) error
- func (sched *Schedulers) SetSchedulerActive(active int64)
- func (sched *Schedulers) SetSchedulerArg1(arg1 string)
- func (sched *Schedulers) SetSchedulerArg2(arg2 string)
- func (sched *Schedulers) SetSchedulerArg3(arg3 string)
- func (sched *Schedulers) SetSchedulerArg4(arg4 string)
- func (sched *Schedulers) SetSchedulerArg5(arg5 string)
- func (sched *Schedulers) SetSchedulerId(id int64)
- func (sched *Schedulers) SetSchedulerIntervalMs(interval_ms int64)
- func (schld *Schedulers) UpdateOneSchedulerInfo(db *sql.DB) error
- type Servers
- func (srvs *Servers) AddOneServers(db *sql.DB) error
- func (srvs *Servers) DeleteOneServers(db *sql.DB) error
- func (srvs *Servers) SetServerCompression(compression uint64)
- func (srvs *Servers) SetServerMaxConnection(max_connections uint64)
- func (srvs *Servers) SetServerMaxLatencyMs(max_latency_ms uint64)
- func (srvs *Servers) SetServerMaxReplicationLag(max_replication_lag uint64)
- func (srvs *Servers) SetServerStatus(status string)
- func (srvs *Servers) SetServerUseSSL(use_ssl uint64)
- func (srvs *Servers) SetServerWeight(weight uint64)
- func (srvs *Servers) SetServersComment(comment string)
- func (srvs *Servers) UpdateOneServerInfo(db *sql.DB) error
- type Status
- type Users
- func (users *Users) AddOneUser(db *sql.DB) error
- func (users *Users) DeleteOneUser(db *sql.DB) error
- func (users *Users) SetBackend(backend uint64)
- func (users *Users) SetFastForward(fast_forward uint64)
- func (users *Users) SetFrontend(frontend uint64)
- func (users *Users) SetMaxConnections(max_connections uint64)
- func (users *Users) SetSchemaLocked(schema_locked uint64)
- func (users *Users) SetTransactionPersistent(transaction_persistent uint64)
- func (users *Users) SetUseSSL(use_ssl uint64)
- func (users *Users) SetUserActive(active uint64)
- func (users *Users) UpdateOneUserInfo(db *sql.DB) error
- type Variables
Constants ¶
const ( CmdProxyReadOnly = `PROXYSQL READONLY` CmdProxyReadWrite = `PROXYSQL READWRITE` CmdProxyStart = `PROXYSQL START` CmdProxyRestart = `PROXYSQL RESTART` CmdProxyStop = `PROXYSQL STOP` CmdProxyPause = `PROXYSQL PAUSE` CmdProxyResume = `PROXYSQL RESUME` CmdProxyShutdown = `PROXYSQL SHUTDOWN` CmdProxyFlushLogs = `PROXYSQL FLUSH LOGS` CmdProxyKill = `PROXYSQL KILL` CmdLoadUserToRuntime = `LOAD MYSQL USERS TO RUNTIME` CmdSaveUserToDisk = `SAVE MYSQL USERS TO DISK` CmdLoadServerToRuntime = `LOAD MYSQL SERVERS TO RUNTIME` CmdSaveServerToDisk = `SAVE MYSQL SERVERS TO DISK` CmdLoadQueryRulesToRuntime = `LOAD MYSQL QUERY RULES TO RUNTIME` CmdSaveQueryRulesToDisk = `SAVE MYSQL QUERY RULES TO DISK` CmdLoadSchedulerToRuntime = `LOAD SCHEDULER TO RUNTIME` CmdSaveSchedulerToDisk = `SAVE SCHEDULER TO DISK` CmdLoadMySQLVariablesToRuntime = `LOAD MYSQL VARIABLES TO RUNTIME` CmdSaveMySQLVariablesToDisk = `SAVE MYSQL VARIABLES TO DISK` CmdLoadAdminVariablesToRuntime = `LOAD ADMIN VARIABLES TO RUNTIME` CmdSaveAdminVariablesToDisk = `SAVE ADMIN VARIABLES TO DISK` )
define commands
const ( /*new query rules*/ StmtAddOneQr = ` INSERT INTO mysql_query_rules(rule_id,username) VALUES(%d,%s)` /*delete a query rules*/ StmtDeleteOneQr = ` DELETE FROM mysql_query_rules WHERE rule_id = %d` /*query all query rules.*/ StmtFindAllQr = `` /* 1040-byte string literal not displayed */ /*find last insert rule_id*/ StmtFindLastRuleId = ` SELECT max(rule_id) FROM mysql_query_rules WHERE username = %s` /*update a query rules.*/ StmtUpdateOneQr = `` /* 477-byte string literal not displayed */ )
const ( // add a new replication hostgroup StmtAddOneRHG = ` INSERT INTO mysql_replication_hostgroups(writer_hostgroup,reader_hostgroup,comment) VALUES(%d,%d,%q)` // Update a replication hostgroup. StmtUpdateOneRHG = ` UPDATE mysql_replication_hostgroups SET writer_hostgroup = %d, reader_hostgroup = %d, comment = %q ` // Delete a replication hostgroup. StmtDeleteOneRHG = ` DELETE FROM mysql_replication_hostgroups WHERE writer_hostgroup = %d AND reader_hostgroup = %d ` StmtQueryAllRHGs = ` SELECT * FROM mysql_replication_hostgroups LIMIT %d OFFSET %d ` )
const ( /*add a new scheduler*/ StmtAddOneScheduler = ` INSERT INTO scheduler(id,filename,interval_ms,active,arg1,arg2,arg3,arg4,arg5) VALUES(%d,%q,%d,%d,%q,%q,%q,%q,%q)` /*delete a scheduler*/ StmtDeleteOneScheduler = ` DELETE FROM scheduler WHERE id = %d` /*update a scheduler*/ StmtUpdateOneScheduler = `` /* 165-byte string literal not displayed */ /*query all schedulers.*/ StmtFindAllScheduler = `` /* 200-byte string literal not displayed */ /*query Last Insert Id*/ StmtFindLastInsertId = ` SELECT max(id) FROM scheduler WHERE filename = %q AND interval_ms = %d` )
const ( /*add a new backends.*/ StmtAddOneServers = ` INSERT INTO mysql_servers( hostgroup_id, hostname, port, max_connections ) VALUES(%d,%q,%d,%d)` /*delete a backend*/ StmtDeleteOneServers = ` DELETE FROM mysql_servers WHERE hostgroup_id=%d AND hostname=%q AND port=%d` /*update a backends*/ StmtUpdateOneServer = `` /* 231-byte string literal not displayed */ /*list all mysql_servers*/ StmtFindAllServer = `` /* 474-byte string literal not displayed */ )
const ( /*add a new users*/ StmtAddOneUser = ` INSERT INTO mysql_users(username,password,default_hostgroup,default_schema) VALUES(%q,%q,%d,%q)` /*delete a user*/ StmtDeleteOneUser = ` DELETE FROM mysql_users WHERE username = %q AND backend = %d AND frontend = %d ` /*list all users*/ StmtFindAllUserInfo = `` /* 358-byte string literal not displayed */ /*update a users*/ StmtUpdateOneUser = `` /* 304-byte string literal not displayed */ )
const ( StmtGlobalVariables = `SHOW GLOBAL VARIABLES` StmtUpdateOneVariable = ` UPDATE global_variables SET variable_value=%q WHERE variable_name = %q` )
const (
StmtMySQLStatus = `SHOW MYSQL STATUS`
)
Variables ¶
This section is empty.
Functions ¶
func LoadAdminVariablesToRuntime ¶
execute load admin variables to runtime.
func LoadMySQLVariablesToRuntime ¶
execute load mysql variables to runtime.
func LoadQueryRulesToRuntime ¶
execute load mysql query rules to runtime.
func LoadSchedulerToRuntime ¶
execute load schedulers to runtime.
func LoadServerToRuntime ¶
execute load mysql servers to runtime.
func LoadUserToRuntime ¶
execute load mysql users to runtime.
func SaveAdminVariablesToDisk ¶
execute save admin variables to disk.
func SaveMySQLVariablesToDisk ¶
execute save mysql variables to runtime.
func SaveQueryRulesToDisk ¶
execute save mysql query rules to disk.
func SaveSchedulerToDisk ¶
execute save schedulers to disk.
Types ¶
type Conn ¶
type Conn struct { Addr string Port uint64 User string Password string Database string Charset string Collation string DBI string Retry uint64 }
connect proxysql use admin user.
func (*Conn) SetCharset ¶
set character set .such as : utf8
func (*Conn) SetCollation ¶
set collation.such as : utf8_general_ci
type PsStatus ¶
type PsStatus struct { Active_Transactions int64 `db:"Active_Transactions" json:"Active_Transactions"` Backend_query_time_nsec int64 `db:"Backend_query_time_nsec" json:"Backend_query_time_nsec"` Client_Connections_aborted int64 `db:"Client_Connections_aborted" json:"Client_Connections_aborted"` Client_Connections_connected int64 `db:"Client_Connections_connected" json:"Client_Connections_connected"` Client_Connections_created int64 `db:"Client_Connections_created" json:"Client_Connections_created"` Client_Connections_non_idle int64 `db:"Client_Connections_non_idle" json:"Client_Connections_non_idle"` Com_autocommit int64 `db:"Com_autocommit" json:"Com_autocommit"` Com_autocommit_filtered int64 `db:"Com_autocommit_filtered" json:"Com_autocommit_filtered"` Com_commit int64 `db:"Com_commit" json:"Com_commit"` Com_commit_filtered int64 `db:"Com_commit_filtered" json:"Com_commit_filtered"` Com_rollback int64 `db:"Com_rollback" json:"Com_rollback"` Com_rollback_filtered int64 `db:"Com_rollback_filtered" json:"Com_rollback_filtered"` Com_stmt_close int64 `db:"Com_stmt_close" json:"Com_stmt_close"` Com_stmt_execute int64 `db:"Com_stmt_execute" json:"Com_stmt_execute"` Com_stmt_prepare int64 `db:"Com_stmt_prepare" json:"Com_stmt_prepare"` ConnPool_get_conn_failure int64 `db:"ConnPool_get_conn_failure" json:"ConnPool_get_conn_failure"` ConnPool_get_conn_immediate int64 `db:"ConnPool_get_conn_immediate" json:"ConnPool_get_conn_immediate"` ConnPool_get_conn_success int64 `db:"ConnPool_get_conn_success" json:"ConnPool_get_conn_success"` ConnPool_memory_bytes int64 `db:"ConnPool_memory_bytes" json:"ConnPool_memory_bytes"` MySQL_Monitor_Workers int64 `db:"MySQL_Monitor_Workers" json:"MySQL_Monitor_Workers"` MySQL_Thread_Workers int64 `db:"MySQL_Thread_Workers" json:"MySQL_Thread_Workers"` ProxySQL_Uptime int64 `db:"ProxySQL_Uptime" json:"ProxySQL_Uptime"` Queries_backends_bytes_recv int64 `db:"Queries_backends_bytes_recv" json:"Queries_backends_bytes_recv"` Queries_backends_bytes_sent int64 `db:"Queries_backends_bytes_sent" json:"Queries_backends_bytes_sent"` Query_Cache_Entries int64 `db:"Query_Cache_Entries" json:"Query_Cache_Entries"` Query_Cache_Memory_bytes int64 `db:"Query_Cache_Memory_bytes" json:"Query_Cache_Memory_bytes"` Query_Cache_Purged int64 `db:"Query_Cache_Purged" json:"Query_Cache_Purged"` Query_Cache_bytes_IN int64 `db:"Query_Cache_bytes_IN" json:"Query_Cache_bytes_IN"` Query_Cache_bytes_OUT int64 `db:"Query_Cache_bytes_OUT" json:"Query_Cache_bytes_OUT"` Query_Cache_count_GET int64 `db:"Query_Cache_count_GET" json:"Query_Cache_count_GET"` Query_Cache_count_GET_OK int64 `db:"Query_Cache_count_GET_OK" json:"Query_Cache_count_GET_OK"` Query_Cache_count_SET int64 `db:"Query_Cache_count_SET" json:"Query_Cache_count_SET"` Query_Processor_time_nsec int64 `db:"Query_Processor_time_nsec" json:"Query_Processor_time_nsec"` Questions int64 `db:"Questions" json:"Questions"` SQLite3_memory_bytes int64 `db:"SQLite3_memory_bytes" json:"SQLite3_memory_bytes"` Server_Connections_aborted int64 `db:"Server_Connections_aborted" json:"Server_Connections_aborted"` Server_Connections_connected int64 `db:"Server_Connections_connected" json:"Server_Connections_connected"` Server_Connections_created int64 `db:"Server_Connections_created" json:"Server_Connections_created"` Servers_table_version int64 `db:"Servers_table_version" json:"Servers_table_version"` Slow_queries int64 `db:"Slow_queries" json:"Slow_queries"` Stmt_Active_Total int64 `db:"Stmt_Active_Total" json:"Stmt_Active_Total"` Stmt_Active_Unique int64 `db:"Stmt_Active_Unique" json:"Stmt_Active_Unique"` Stmt_Max_Stmt_id int64 `db:"Stmt_Max_Stmt_id" json:"Stmt_Max_Stmt_id"` Mysql_backend_buffers_bytes int64 `db:"mysql_backend_buffers_bytes" json:"mysql_backend_buffers_bytes"` Mysql_frontend_buffers_bytes int64 `db:"mysql_frontend_buffers_bytes" json:"mysql_frontend_buffers_bytes"` Mysql_session_internal_bytes int64 `db:"mysql_session_internal_bytes" json:"mysql_session_internal_bytes"` }
type QueryRules ¶
type QueryRules struct { Rule_id uint64 `db:"rule_id" json:"rule_id"` Active uint64 `db:"active" json:"active"` Username string `db:"username" json:"username"` Schemaname string `db:"schemaname" json:"schemaname"` FlagIN uint64 `db:"flagIN" json:"flagIN"` Client_addr string `db:"client_addr" json:"client_addr"` Proxy_addr string `db:"proxy_addr" json:"proxy_addr"` Proxy_port string `db:"proxy_port" json:"proxy_port"` Digest string `db:"digest" json:"digest"` Match_digest string `db:"match_digest" json:"match_digest"` Match_pattern string `db:"match_pattern" json:"match_pattern"` Negate_match_pattern uint64 `db:"negate_match_pattern" json:"negate_match_pattern"` FlagOUT string `db:"flagOUT" json:"flagOUT"` Replace_pattern string `db:"replace_pattern" json:"replace_pattern"` Destination_hostgroup string `db:"destination_hostgroup" json:"destination_hostgroup"` Cache_ttl string `db:"cache_ttl" json:"cache_ttl"` Reconnect string `db:"reconnect" json:"reconnect"` Timeout string `db:"timeout" json:"timeout"` Retries string `db:"retries" json:"retries"` Delay string `db:"delay" json:"delay"` Mirror_flagOUT string `db:"mirror_flagOUT" json:"mirror_flagOUT"` Mirror_hostgroup string `db:"mirror_hostgroup" json:"mirror_hostgroup"` Error_msg string `db:"error_msg" json:"error_msg"` Log string `db:"log" json:"log"` Apply uint64 `db:"apply" json:"apply"` Comment string `db:"comment" json:"comment"` }
func (*QueryRules) AddOneQr ¶
func (qr *QueryRules) AddOneQr(db *sql.DB) error
add a new query rules.
func (*QueryRules) DeleteOneQr ¶
func (qr *QueryRules) DeleteOneQr(db *sql.DB) error
delete a query rules.
func (*QueryRules) SetProxyPort ¶
func (qr *QueryRules) SetProxyPort(proxy_port string)
set qr proxy_port
func (*QueryRules) SetQrCacheTTL ¶
func (qr *QueryRules) SetQrCacheTTL(cache_ttl string)
set qr cache_ttl
func (*QueryRules) SetQrClientAddr ¶
func (qr *QueryRules) SetQrClientAddr(client_addr string)
set qr client_addr
func (*QueryRules) SetQrDestHostGroup ¶
func (qr *QueryRules) SetQrDestHostGroup(destination_hostgroup string)
set qr destination_hostgroup
func (*QueryRules) SetQrErrorMsg ¶
func (qr *QueryRules) SetQrErrorMsg(error_msg string)
set qr error_msg
func (*QueryRules) SetQrFlagOut ¶
func (qr *QueryRules) SetQrFlagOut(flag_out string)
set qr flagout
func (*QueryRules) SetQrMatchDigest ¶
func (qr *QueryRules) SetQrMatchDigest(match_digest string)
set qr match_digest
func (*QueryRules) SetQrMatchPattern ¶
func (qr *QueryRules) SetQrMatchPattern(match_pattern string)
set qr match_pattern
func (*QueryRules) SetQrMirrorFlagOUT ¶
func (qr *QueryRules) SetQrMirrorFlagOUT(mirror_flagout string)
set qr mirror_flagout
func (*QueryRules) SetQrMirrorHostgroup ¶
func (qr *QueryRules) SetQrMirrorHostgroup(mirror_hostgroup string)
set qr mirror_hostgroup
func (*QueryRules) SetQrNegateMatchPattern ¶
func (qr *QueryRules) SetQrNegateMatchPattern(negate_match_pattern uint64)
set qr mnegate_match_pattern
func (*QueryRules) SetQrProxyAddr ¶
func (qr *QueryRules) SetQrProxyAddr(proxy_addr string)
set qr proxy_addr
func (*QueryRules) SetQrReconnect ¶
func (qr *QueryRules) SetQrReconnect(reconnect string)
set qr reconnect
func (*QueryRules) SetQrReplacePattern ¶
func (qr *QueryRules) SetQrReplacePattern(replace_pattern string)
set qr replace_pattern
func (*QueryRules) SetQrSchemaname ¶
func (qr *QueryRules) SetQrSchemaname(schema_name string)
set qr schemaname
func (*QueryRules) UpdateOneQrInfo ¶
func (qr *QueryRules) UpdateOneQrInfo(db *sql.DB) error
update a query rules.
type ReplicationHostgroup ¶
type ReplicationHostgroup struct { WriterHostgroup uint64 `json:"writer_hostgroup" db:"writer_hostgroup"` ReaderHostgroup uint64 `json:"reader_hostgroup" db:"reader_hostgroup"` Comment string `json:"comment" db:"comment"` }
func NewRHG ¶
func NewRHG(whg uint64, rhg uint64) (*ReplicationHostgroup, error)
new replication hostgroup instance
func QueryAllRHG ¶
list all mysql_servers
func (*ReplicationHostgroup) AddOneRHG ¶
func (rhg *ReplicationHostgroup) AddOneRHG(db *sql.DB) error
add one new replication hostgroup
func (*ReplicationHostgroup) DeleteOneRHG ¶
func (rhg *ReplicationHostgroup) DeleteOneRHG(db *sql.DB) error
delete one replication hostgroup
func (*ReplicationHostgroup) SetComment ¶
func (rhg *ReplicationHostgroup) SetComment(comment string)
set comment
func (*ReplicationHostgroup) SetReaderHostGroup ¶
func (rhg *ReplicationHostgroup) SetReaderHostGroup(reader uint64)
set reader hostgroup
func (*ReplicationHostgroup) SetWriterHostGroup ¶
func (rhg *ReplicationHostgroup) SetWriterHostGroup(writer uint64)
set writer hostgroup
func (*ReplicationHostgroup) UpdateOneRHG ¶
func (rhg *ReplicationHostgroup) UpdateOneRHG(db *sql.DB) error
update one replication hostgroup
type Schedulers ¶
type Schedulers struct { Id int64 `json:"id" db:"id"` Active int64 `json:"active" db:"active"` IntervalMs int64 `json:"interval_ms" db:"interval_ms"` FileName string `json:"filename" db:"filename"` Arg1 string `json:"arg1" db:"arg1"` Arg2 string `json:"arg2" db:"arg2"` Arg3 string `json:"arg3" db:"arg3"` Arg4 string `json:"arg4" db:"arg4"` Arg5 string `json:"arg5" db:"arg5"` Comment string `json:"comment" db:"comment"` }
func FindAllSchedulerInfo ¶
query all schedulers
func (*Schedulers) AddOneScheduler ¶
func (schld *Schedulers) AddOneScheduler(db *sql.DB) error
add a new scheduler
func (*Schedulers) DeleteOneScheduler ¶
func (schld *Schedulers) DeleteOneScheduler(db *sql.DB) error
delete a scheduler
func (*Schedulers) SetSchedulerActive ¶
func (sched *Schedulers) SetSchedulerActive(active int64)
Set Scheduler Active status
func (*Schedulers) SetSchedulerArg1 ¶
func (sched *Schedulers) SetSchedulerArg1(arg1 string)
Set Scheduler all Args
func (*Schedulers) SetSchedulerArg2 ¶
func (sched *Schedulers) SetSchedulerArg2(arg2 string)
func (*Schedulers) SetSchedulerArg3 ¶
func (sched *Schedulers) SetSchedulerArg3(arg3 string)
func (*Schedulers) SetSchedulerArg4 ¶
func (sched *Schedulers) SetSchedulerArg4(arg4 string)
func (*Schedulers) SetSchedulerArg5 ¶
func (sched *Schedulers) SetSchedulerArg5(arg5 string)
func (*Schedulers) SetSchedulerId ¶
func (sched *Schedulers) SetSchedulerId(id int64)
Set Scheduler id
func (*Schedulers) SetSchedulerIntervalMs ¶
func (sched *Schedulers) SetSchedulerIntervalMs(interval_ms int64)
Set scheduler interval_ms
func (*Schedulers) UpdateOneSchedulerInfo ¶
func (schld *Schedulers) UpdateOneSchedulerInfo(db *sql.DB) error
update a scheduler.
type Servers ¶
type Servers struct { HostGroupId uint64 `db:"hostgroup_id,omitempty" json:"hostgroup_id"` HostName string `db:"hostname" json:"hostname"` Port uint64 `db:"port" json:"port"` Status string `db:"status" json:"status"` Weight uint64 `db:"weight" json:"weight"` Compression uint64 `db:"compression" json:"compression"` MaxConnections uint64 `db:"max_connections" json:"max_connections"` MaxReplicationLag uint64 `db:"max_replication_lag" json:"max_replication_lag"` UseSsl uint64 `db:"use_ssl" json:"use_ssl"` MaxLatencyMs uint64 `db:"max_latency_ms" json:"max_latency_ms"` Comment string `db:"comment" json:"comment"` }
func FindAllServerInfo ¶
list all mysql_servers
func (*Servers) AddOneServers ¶
add a new backend
func (*Servers) DeleteOneServers ¶
delete a backend
func (*Servers) SetServerCompression ¶
set servers compression
func (*Servers) SetServerMaxConnection ¶
set servers max_connections
func (*Servers) SetServerMaxLatencyMs ¶
set servers max_latency_ms
func (*Servers) SetServerMaxReplicationLag ¶
set servers max_replication_lag
func (*Servers) SetServerStatus ¶
set servers status
func (*Servers) SetServerUseSSL ¶
set servers use_ssl
func (*Servers) SetServerWeight ¶
set servers weight
func (*Servers) SetServersComment ¶
set servers comment
type Users ¶
type Users struct { Username string `db:"username" json:"username"` Password string `db:"password" json:"password"` Active uint64 `db:"active" json:"active"` UseSsl uint64 `db:"use_ssl" json:"use_ssl"` DefaultHostgroup uint64 `db:"default_hostgroup" json:"default_hostgroup"` DefaultSchema string `db:"default_schema" json:"default_schema"` SchemaLocked uint64 `db:"schema_locked" json:"schema_locked"` TransactionPersistent uint64 `db:"transaction_persistent" json:"transaction_persistent"` FastForward uint64 `db:"fast_forward" json:"fast_forward"` Backend uint64 `db:"backend" json:"backend"` Frontend uint64 `db:"frontend" json:"frontend"` MaxConnections uint64 `db:"max_connections" json:"max_connections"` }
func FindAllUserInfo ¶
list all users.
func (*Users) SetFastForward ¶
set fast_forward
func (*Users) SetMaxConnections ¶
set max_connections
func (*Users) SetSchemaLocked ¶
set users SchemaLocked
func (*Users) SetTransactionPersistent ¶
set users transaction_persistent
func (*Users) SetUserActive ¶
set user active/disactive