helper

package
v0.0.0-...-b97b37b Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExecDBPriv

func CheckExecDBPriv(ctx *contexts.GlobalContext, dbNames []string, metaClusterId int64, username string) error

func CheckMysqlPriv

func CheckMysqlPriv(c *gin.Context, ctx *contexts.GlobalContext, db_name string, meta_cluster_id int64) (*models.MysqlDBPriv, error)

func CheckMysqlPrivById

func CheckMysqlPrivById(c *gin.Context, ctx *contexts.GlobalContext, privId int64) (*models.MysqlDBPriv, error)

func ConvertRowMapToRows

func ConvertRowMapToRows(rowMap []map[string]interface{}, columnNames []string) ([][]interface{}, error)

func FilterIgnoreDatabases

func FilterIgnoreDatabases(databases []string) []string

过滤掉可以忽略掉数据库

func FindDBNameByHostPort

func FindDBNameByHostPort(ctx *contexts.GlobalContext, host string, port int64) ([]string, error)

func FindDBNameByVipPort

func FindDBNameByVipPort(ctx *contexts.GlobalContext, vipPort string) ([]string, error)

func GetMasterHostAndPortWithMetaCluster

func GetMasterHostAndPortWithMetaCluster(cluster *models.MetaCluster) (string, int64, error)

获取master host和port

func GetMasterHostrPortSlavesMap

func GetMasterHostrPortSlavesMap(instances []*response.InstanceClusterResponse) map[string][]*response.InstanceClusterResponse

获取slave对应的 master map 实例集群map, key: host:port, value: slaves key是空字符串, 是主实例

func GetMasters

func GetMasters(instances []*view_models.InstanceCluster) []*view_models.InstanceCluster

获取所有master

func InstanceClustersToMasterSlavesResps

func InstanceClustersToMasterSlavesResps(instances []*view_models.InstanceCluster) []*response.InstanceClusterResponse

实例集群信息转化成api返回信息 如果只有slave没有master, 则会不显示

func InstanceClustersToResps

func InstanceClustersToResps(instances []*view_models.InstanceCluster) []*response.InstanceClusterResponse

func MateClustersToIdMap

func MateClustersToIdMap(clusters []*models.MetaCluster) map[int64]*models.MetaCluster

func MetaClusterToClusterResponse

func MetaClusterToClusterResponse(metaCluster *models.MetaCluster) *response.ClusterResponse

func MetaClusterToClusterResponses

func MetaClusterToClusterResponses(metaClusters []*models.MetaCluster) []*response.ClusterResponse

func MetaClusterToNameResponses

func MetaClusterToNameResponses(metaClusters []*models.MetaCluster) []*response.ClusterNameResponse

func MysqlPrivsToTree

func MysqlPrivsToTree(privs []*models.MysqlDBPriv) []*response.MysqlPrivsTreeResponse

func StartExecSingleMysqlSql

func StartExecSingleMysqlSql(ctx *contexts.GlobalContext, priv *models.MysqlDBPriv, query string) ([]map[string]interface{}, []string, error)

指定单实例mysql

func UniqueMysqlPrivApplys

func UniqueMysqlPrivApplys(applys []*models.MysqlDBPrivApply) []*models.MysqlDBPrivApply

申请权限去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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