Documentation
¶
Overview ¶
*
- 数据模型的存储逻辑
Index ¶
- Constants
- func InitService(c *config.Config)
- type Service
- func (s *Service) AddPeer(clusterId int, rangeId string) error
- func (s *Service) AddRole(roleId int, roleName string) error
- func (s *Service) AdjustScheduler(clusterId, optType int, scheduler string) error
- func (s *Service) ApplyLockNamespace(cId int, namespace, applyer string, cTime int64) error
- func (s *Service) ApplySql(dbName, tableName, sentence, applyer, remark string, cTime int64) error
- func (s *Service) AuditSql(ids []string, status int, auditor string) error
- func (s *Service) BatchCreateTopologyRange(clusterId int, dbName, tableName string) error
- func (s *Service) BatchRecoverRange(clusterId int, dbName, tableName string) error
- func (s *Service) ChangeRangeLeader(clusterId int, rangeId int, peerId int) error
- func (s *Service) CheckTopology(clusterId int, dbName, tableName string) error
- func (s *Service) CreateCluster(cId int, cName, masterUrl, gateHttpUrl, gateSqlUrl, cToken string, cTime int64) error
- func (s *Service) CreateDb(cId int, dbName string) error
- func (s *Service) CreateMetricServer(addr string) error
- func (s *Service) CreateTable(cId int, dbName, tableName, policy, rangeKeys string, ...) error
- func (s *Service) CreateTopologyRange(clusterId int, dbName, tableName, startKey, endKey string) error
- func (s *Service) DelPrivilege(privileges []models.UserPrivilege) error
- func (s *Service) DelRole(roleIds []int) error
- func (s *Service) DeleteMetricServer(addrs []string) error
- func (s *Service) DeleteNodes(clusterId int, nodeIds string) error
- func (s *Service) DeletePeer(clusterId int, rangeId, peerId string) (interface{}, error)
- func (s *Service) DeleteRange(clusterId int, rangeId int) error
- func (s *Service) DeleteTable(cId int, dbName, tableName, flag string) error
- func (s *Service) EditTable(cId int, dbName, tableName, rangeKeys string, ...) error
- func (s *Service) GetAllClusters() ([]*models.ClusterInfo, error)
- func (s *Service) GetAllDb(cId int) (*[]models.DbInfo, error)
- func (s *Service) GetAllMetricServer() ([]models.MetricServer, error)
- func (s *Service) GetAllNamespace(userName string, isAdmin bool) ([]*models.NamespaceApply, error)
- func (s *Service) GetAllSqlApply(userName string, isAdmin bool) ([]*models.SqlApply, error)
- func (s *Service) GetAllTables(cId int, dbId, dbName string) (*[]models.TableInfo, error)
- func (s *Service) GetClusterById(ids ...int64) ([]*models.ClusterInfo, error)
- func (s *Service) GetClusterTopology(clusterId int) (interface{}, error)
- func (s *Service) GetDb() *sql.DB
- func (s *Service) GetLockCluster() (*models.ClusterInfo, error)
- func (s *Service) GetMasterAll(cId int, token string) (*models.Member, error)
- func (s *Service) GetMasterLeader(cId int, token string) (interface{}, error)
- func (s *Service) GetMetricConfig(cId int) (map[string]*models.MetricConfig, error)
- func (s *Service) GetNodeViewInfo(cId int) ([]*models.DsNode, error)
- func (s *Service) GetPeerInfo(clusterId int, dbName, tableName string, rangeId int) (interface{}, error)
- func (s *Service) GetPresentTask(clusterId int) (interface{}, error)
- func (s *Service) GetPrivilegeInfo(offset, limit int, order string) ([]*models.UserPrivilege, error)
- func (s *Service) GetRangeDuplicate(clusterId int, dbName, tableName string) (interface{}, error)
- func (s *Service) GetRangeOpsTopN(clusterId int, topN int) (interface{}, error)
- func (s *Service) GetRangeTopoByNodeId(clusterId, nodeId int) (interface{}, error)
- func (s *Service) GetRangeTopoByRangeId(clusterId int, rangeId int) (interface{}, error)
- func (s *Service) GetRangeViewInfo(dbName, tName string, clusterId uint64) ([]*models.Route, error)
- func (s *Service) GetRoleInfo(offset, limit int, order string) ([]*models.Role, error)
- func (s *Service) GetSchedulerAll(clusterId int) (map[string]bool, error)
- func (s *Service) GetSchedulerDetail(clusterId int, name string) (interface{}, error)
- func (s *Service) GetSqlApplyInfo(id string) (*models.SqlApply, error)
- func (s *Service) GetTableColumns(cId int, tableName, dbName string) (*models.TableInfo, error)
- func (s *Service) GetTableTopologyMissing(clusterId int, dbName, tableName string) (interface{}, error)
- func (s *Service) GetTaskType(clusterId int) ([]string, error)
- func (s *Service) GetUnhealthyRanges(clusterId int, dbName, tableName string, rangeId string) (interface{}, error)
- func (s *Service) GetUnstableRanges(clusterId int, dbName, tableName string) (interface{}, error)
- func (s *Service) GetUserInfoByErp(erp string) (*models.UserInfo, error)
- func (s *Service) InitCluster(cId int, masterUrl string, token string) error
- func (s *Service) IsAdmin(userName string) (bool, error)
- func (s *Service) OfflineRange(clusterId int, dbName, tableName string, rangeId, peerId int) error
- func (s *Service) OperateDb(clusterId int, paramMap map[string]string) (int64, error)
- func (s *Service) QueryDb(clusterId int, paramMap map[string]string) (interface{}, error)
- func (s *Service) RebuildRange(clusterId int, dbName, tableName string, rangeId int) error
- func (s *Service) ReplaceRange(clusterId int, dbName, tableName string, rangeId, peerId int) error
- func (s *Service) SetClusterToggle(clusterId int, autoTransfer, autoFailover, autoSplit string) error
- func (s *Service) SetMasterLogLevel(clusterId int, logLevel string) error
- func (s *Service) SetMetricConfig(cId int, addr, interval string) (map[string]string, error)
- func (s *Service) SetNodeLogIn(clusterId, nodeId int) error
- func (s *Service) SetNodeLogLevel(clusterId, nodeId int, logLevel string) error
- func (s *Service) SetNodeLogOut(clusterId, nodeId int) error
- func (s *Service) SetNodeUpgrade(clusterId, nodeId int) error
- func (s *Service) TaskOperate(clusterId int, operate string, taskIds string) (interface{}, error)
- func (s *Service) TransferRange(clusterId int, rangeId int, peerId int) error
- func (s *Service) UpdateLockNsp(cId int, namespace, applyer string, cTime int64) error
- func (s *Service) UpdatePrivilege(userName string, clusterId, roleId int) error
- func (s *Service) UpdateRange(clusterId int, dbName, tableName string, rangeId, peerId int) error
Constants ¶
View Source
const ( //DB_NAME = "fbase_mock_console" DB_NAME = "fbase" LOCK_DBNAME = "lock" LOCK_COLUMN = "lock_col" TABLE_NAME_USER = "fbase_user" TABLE_NAME_CLUSTER = "fbase_cluster" TABLE_NAME_ROLE = "fbase_role" TABLE_NAME_PRIVILEGE = "fbase_privilege" TABLE_NAME_SQL_APPLY = "fbase_sql_apply" TABLE_NAME_LOCK_NSP = "fbase_lock_nsp" TABLE_NAME_METRIC_SERVER = "metric_server" )
Variables ¶
This section is empty.
Functions ¶
func InitService ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService() *Service
func (*Service) AdjustScheduler ¶
func (*Service) ApplyLockNamespace ¶
func (*Service) BatchCreateTopologyRange ¶
func (*Service) BatchRecoverRange ¶
func (*Service) ChangeRangeLeader ¶
切换主
func (*Service) CheckTopology ¶
func (*Service) CreateCluster ¶
func (*Service) CreateMetricServer ¶ added in v0.6.3
func (*Service) CreateTable ¶
func (*Service) CreateTopologyRange ¶
func (*Service) DelPrivilege ¶
func (s *Service) DelPrivilege(privileges []models.UserPrivilege) error
func (*Service) DeleteMetricServer ¶ added in v0.6.3
func (*Service) DeletePeer ¶
func (*Service) DeleteTable ¶
func (*Service) GetAllClusters ¶
func (s *Service) GetAllClusters() ([]*models.ClusterInfo, error)
func (*Service) GetAllMetricServer ¶ added in v0.6.3
func (s *Service) GetAllMetricServer() ([]models.MetricServer, error)
func (*Service) GetAllNamespace ¶
=============lock start==============
func (*Service) GetAllSqlApply ¶ added in v0.6.3
=============sql apply start==============
func (*Service) GetAllTables ¶
func (*Service) GetClusterById ¶
func (s *Service) GetClusterById(ids ...int64) ([]*models.ClusterInfo, error)
func (*Service) GetClusterTopology ¶
func (*Service) GetLockCluster ¶
func (s *Service) GetLockCluster() (*models.ClusterInfo, error)
func (*Service) GetMasterAll ¶
func (*Service) GetMasterLeader ¶
func (*Service) GetMetricConfig ¶ added in v0.6.3
func (*Service) GetNodeViewInfo ¶
func (*Service) GetPeerInfo ¶
func (*Service) GetPresentTask ¶
func (*Service) GetPrivilegeInfo ¶
func (*Service) GetRangeDuplicate ¶
func (*Service) GetRangeOpsTopN ¶
func (*Service) GetRangeTopoByNodeId ¶
func (*Service) GetRangeTopoByRangeId ¶
func (*Service) GetRangeViewInfo ¶
func (*Service) GetRoleInfo ¶
func (*Service) GetSchedulerAll ¶
func (*Service) GetSchedulerDetail ¶
func (*Service) GetSqlApplyInfo ¶ added in v0.6.3
func (*Service) GetTableColumns ¶
func (*Service) GetTableTopologyMissing ¶
func (*Service) GetUnhealthyRanges ¶
func (*Service) GetUnstableRanges ¶
func (*Service) GetUserInfoByErp ¶
func (*Service) InitCluster ¶
func (*Service) OfflineRange ¶
func (*Service) RebuildRange ¶
func (*Service) ReplaceRange ¶
func (*Service) SetClusterToggle ¶
func (*Service) SetMasterLogLevel ¶
func (*Service) SetMetricConfig ¶ added in v0.6.3
func (*Service) SetNodeLogIn ¶
func (*Service) SetNodeLogLevel ¶
func (*Service) SetNodeLogOut ¶
func (*Service) SetNodeUpgrade ¶
func (*Service) TaskOperate ¶
func (*Service) TransferRange ¶
迁移
func (*Service) UpdateLockNsp ¶
func (*Service) UpdatePrivilege ¶
Click to show internal directories.
Click to hide internal directories.