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) ApplyConfigureNsp(cId int, dbName, tableName, applyer string, cTime int64) error
- func (s *Service) ApplyLockNsp(cId int, dbName, tableName, applyer string, cTime int64) error
- func (s *Service) ApplyNamespace(cId int, dbName, tableName, applyer string, cTime int64, storeTable string) error
- func (s *Service) ApplySql(dbName, tableName, sentence, applyer, remark string, cTime int64) error
- func (s *Service) AuditConfigureNsp(ids []string, status int, auditor string) error
- func (s *Service) AuditLockNsp(ids []string, status int, auditor string) 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) ComputeClientToken(dbId, tableId int) string
- func (s *Service) CreateCluster(cId int, cName, masterUrl, gateHttpUrl, gateSqlUrl, cToken string, cTime int64) error
- func (s *Service) CreateDb(cId int, dbName string) (*models.DbInfo, error)
- func (s *Service) CreateMetricServer(addr string) error
- func (s *Service) CreateTable(cId int, dbName, tableName, policy, rangeKeys string, ...) (*models.TableInfo, 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) DeleteConfigureNsp(ids []string) error
- func (s *Service) DeleteDb(cId int, dbName string) error
- func (s *Service) DeleteLockNsp(ids []string) error
- func (s *Service) DeleteMetricServer(addrs []string) error
- func (s *Service) DeleteNodes(clusterId int, nodeIds string) error
- func (s *Service) DeleteNsp(ids []string, storeTable 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) ForceUnLock(clusterId int, dbName, tableName, key string) error
- func (s *Service) GetAllClusters() ([]*models.ClusterInfo, error)
- func (s *Service) GetAllConfigure(clusterId int, dbName, tableName string, pageInfo *models.PagerInfo) ([]*models.ConfigureInfo, error)
- func (s *Service) GetAllConfigureNsp(userName string, isAdmin bool, pageInfo *models.PagerInfo) (int, []*models.NamespaceApply, error)
- func (s *Service) GetAllDb(cId int) (*[]models.DbInfo, error)
- func (s *Service) GetAllLock(clusterId int, dbName, tableName string, pageInfo *models.PagerInfo) ([]*models.LockInfo, error)
- func (s *Service) GetAllLockNsp(userName string, isAdmin bool, pageInfo *models.PagerInfo) (int, []*models.NamespaceApply, error)
- func (s *Service) GetAllMetricServer() ([]models.MetricServer, error)
- func (s *Service) GetAllNamespace(userName string, isAdmin bool, pageInfo *models.PagerInfo, tableName string) (int, []*models.NamespaceApply, error)
- func (s *Service) GetAllSqlApply(userName string, isAdmin bool, pageInfo *models.PagerInfo) (int, []*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) GetClusterInfo(clusterId int) (*models.ClusterInfo, error)
- func (s *Service) GetClusterTopology(clusterId int) (interface{}, error)
- func (s *Service) GetConfigureClusterList() ([]*models.ClusterInfo, error)
- func (s *Service) GetDb() *sql.DB
- func (s *Service) GetLockClusterList() ([]*models.ClusterInfo, error)
- func (s *Service) GetMasterAll(cId int, token string) (*models.Member, error)
- func (s *Service) GetMasterLeader(cId int, token string) (*models.MsNode, error)
- func (s *Service) GetMetricConfig(cId int) (map[string]*models.MetricConfig, error)
- func (s *Service) GetNamespaceById(applyId, storeTable string) (*models.NamespaceApply, 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) UpdateConfigureNsp(applyId, applyer string) error
- func (s *Service) UpdateLockNsp(applyId, applyer string) error
- func (s *Service) UpdateNsp(applyId, applyer, storeTable string) 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" 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_CONFIGURE_NSP = "fbase_configure_nsp" TABLE_NAME_METRIC_SERVER = "metric_server" STATUS_APPLY = 1 STATUS_AUDIT = 2 STATUS_REJECT = 3 LOCK_CLIENT_NAMESPACE_PREFIX = "" )
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) ApplyConfigureNsp ¶ added in v0.7.2
func (*Service) ApplyLockNsp ¶ added in v0.7.2
func (*Service) ApplyNamespace ¶ added in v0.7.2
func (*Service) AuditConfigureNsp ¶ added in v0.7.2
func (*Service) AuditLockNsp ¶ added in v0.7.2
func (*Service) BatchCreateTopologyRange ¶
func (*Service) BatchRecoverRange ¶
func (*Service) ChangeRangeLeader ¶
切换主
func (*Service) CheckTopology ¶
func (*Service) ComputeClientToken ¶ added in v0.7.2
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) DeleteConfigureNsp ¶ added in v0.7.2
func (*Service) DeleteLockNsp ¶ added in v0.7.2
func (*Service) DeleteMetricServer ¶ added in v0.6.3
func (*Service) DeletePeer ¶
func (*Service) DeleteTable ¶
func (*Service) ForceUnLock ¶ added in v0.7.2
func (*Service) GetAllClusters ¶
func (s *Service) GetAllClusters() ([]*models.ClusterInfo, error)
func (*Service) GetAllConfigure ¶ added in v0.7.2
func (s *Service) GetAllConfigure(clusterId int, dbName, tableName string, pageInfo *models.PagerInfo) ([]*models.ConfigureInfo, error)
go by http command
func (*Service) GetAllConfigureNsp ¶ added in v0.7.2
func (s *Service) GetAllConfigureNsp(userName string, isAdmin bool, pageInfo *models.PagerInfo) (int, []*models.NamespaceApply, error)
=============configure center start================
func (*Service) GetAllLock ¶ added in v0.7.2
func (s *Service) GetAllLock(clusterId int, dbName, tableName string, pageInfo *models.PagerInfo) ([]*models.LockInfo, error)
go by http command
func (*Service) GetAllLockNsp ¶ added in v0.7.2
func (s *Service) GetAllLockNsp(userName string, isAdmin bool, pageInfo *models.PagerInfo) (int, []*models.NamespaceApply, error)
=============lock start==============
func (*Service) GetAllMetricServer ¶ added in v0.6.3
func (s *Service) GetAllMetricServer() ([]models.MetricServer, error)
func (*Service) GetAllNamespace ¶
func (*Service) GetAllSqlApply ¶ added in v0.6.3
func (s *Service) GetAllSqlApply(userName string, isAdmin bool, pageInfo *models.PagerInfo) (int, []*models.SqlApply, error)
=============sql apply start==============
func (*Service) GetAllTables ¶
func (*Service) GetClusterById ¶
func (s *Service) GetClusterById(ids ...int64) ([]*models.ClusterInfo, error)
func (*Service) GetClusterInfo ¶ added in v0.7.2
func (s *Service) GetClusterInfo(clusterId int) (*models.ClusterInfo, error)
func (*Service) GetClusterTopology ¶
func (*Service) GetConfigureClusterList ¶ added in v0.7.2
func (s *Service) GetConfigureClusterList() ([]*models.ClusterInfo, error)
func (*Service) GetLockClusterList ¶ added in v0.7.2
func (s *Service) GetLockClusterList() ([]*models.ClusterInfo, error)
func (*Service) GetMasterAll ¶
func (*Service) GetMasterLeader ¶
func (*Service) GetMetricConfig ¶ added in v0.6.3
func (*Service) GetNamespaceById ¶ added in v0.7.2
func (s *Service) GetNamespaceById(applyId, storeTable string) (*models.NamespaceApply, error)
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) UpdateConfigureNsp ¶ added in v0.7.2
func (*Service) UpdateLockNsp ¶
func (*Service) UpdatePrivilege ¶
Click to show internal directories.
Click to hide internal directories.