Documentation ¶
Index ¶
- Constants
- Variables
- type AdminModel
- type Config
- type DBConfig
- type DashCore
- func (s *DashCore) AdminLogin(session sessions.Session, admin *models.Admin) (*models.Admin, error)
- func (s *DashCore) AdminModel() AdminModel
- func (s *DashCore) ChangeServerRole(gid int, serveRole, addr string) error
- func (s *DashCore) Close() error
- func (s *DashCore) Compact(addr, dbType string) error
- func (s *DashCore) Config() *Config
- func (s *DashCore) CreateAdmin(admin *models.Admin) error
- func (s *DashCore) CreateGroup(gid int) error
- func (s *DashCore) CreatePConfig(pconfig *models.Pconfig) error
- func (s *DashCore) CreateProxy(addr string) error
- func (s *DashCore) DeRaftGroup(gid int, addr, token string) error
- func (s *DashCore) DeraftAllGroup(token, cloudType string) error
- func (s *DashCore) EnableReplicaGroups(gid int, addr string, value bool) error
- func (s *DashCore) EnableReplicaGroupsAll(value bool) error
- func (s *DashCore) GetAdmin(name string) (*models.Admin, error)
- func (s *DashCore) GetAdminList() (map[string]*models.Admin, error)
- func (s *DashCore) GetClusterMembership(gid int, addr string) (*uredis.MembershipV2, error)
- func (s *DashCore) GetLoginAdmin(session sessions.Session) (*models.Admin, error)
- func (s *DashCore) GetMigrateList() ([]*models.Migrate, error)
- func (s *DashCore) GetNodeHostInfo(gid int, addr string) (string, error)
- func (s *DashCore) GetPConfig(name string) (*models.Pconfig, error)
- func (s *DashCore) GetPConfigList() (map[string]*models.Pconfig, error)
- func (s *DashCore) GroupAddServer(gid int, serveRole, ct, addr string) error
- func (s *DashCore) GroupDelServer(gid int, addr string, nodeId int) error
- func (s *DashCore) GroupMountOrOfflineNode(model int, gid int, serverAddr string, raftAddr string, nodeId int) error
- func (s *DashCore) GroupPromoteServer(gid int, addr string) error
- func (s *DashCore) InitDefaultPconfig()
- func (s *DashCore) InverseReplicaGroupsAll(gid int, addr string) error
- func (s *DashCore) IsClosed() bool
- func (s *DashCore) IsOnline() bool
- func (s *DashCore) LogCompactGroup(gid int) error
- func (s *DashCore) Model() *models.DashCore
- func (s *DashCore) OnlineProxy(addr string) error
- func (s *DashCore) Overview() (*Overview, error)
- func (s *DashCore) ProcessSlotAction() error
- func (s *DashCore) ReRaftGroup(gid int, addr, token string, port int) error
- func (s *DashCore) ReadCrossCloud(flag string) error
- func (s *DashCore) RefreshProxyStats(timeout time.Duration) (*sync2.Future, error)
- func (s *DashCore) RefreshRedisStats(timeout time.Duration) (*sync2.Future, error)
- func (s *DashCore) ReinitProxy(token string) error
- func (s *DashCore) Reload() error
- func (s *DashCore) RemoveAdmin(username string) error
- func (s *DashCore) RemoveGroup(gid int) error
- func (s *DashCore) RemovePConfig(name string) error
- func (s *DashCore) RemoveProxy(token string, force bool) error
- func (s *DashCore) ResyncAllPconfig() error
- func (s *DashCore) ResyncGroup(gid int) error
- func (s *DashCore) ResyncGroupAll() error
- func (s *DashCore) ResyncOnePconfig(name string) error
- func (s *DashCore) SetSlotActionDisabled(value bool)
- func (s *DashCore) SlotActionComplete(sourceAddr string, sid int) error
- func (s *DashCore) SlotActionMigratingMinIndex() (int, bool, error)
- func (s *DashCore) SlotActionPrepare() (int, bool, error)
- func (s *DashCore) SlotActionPrepareFilter(accept, update func(m *models.SlotMapping) bool) (int, bool, error)
- func (s *DashCore) SlotCreateAction(sid int, gid int) error
- func (s *DashCore) SlotCreateActionInit() error
- func (s *DashCore) SlotCreateActionRange(beg, end int, gid int, must, notMigrateData bool) error
- func (s *DashCore) SlotCreateActionSome(groupFrom, groupTo int, numSlots int) error
- func (s *DashCore) SlotRemoveAction(sid int) error
- func (s *DashCore) Slots() ([]*models.Slot, error)
- func (s *DashCore) SlotsAssignGroup(slots []*models.SlotMapping) error
- func (s *DashCore) SlotsAssignOffline(slots []*models.SlotMapping) error
- func (s *DashCore) SlotsRebalance(confirm bool) (map[int]int, error)
- func (s *DashCore) Start(routines bool) error
- func (s *DashCore) Stats() (*Stats, error)
- func (s *DashCore) SyncCreateAction(addr string) error
- func (s *DashCore) SyncRemoveAction(addr string) error
- func (s *DashCore) UpdateAdmin(admin *models.Admin) error
- func (s *DashCore) UpdateDepartment(newDepartment string) error
- func (s *DashCore) UpdatePConfig(pconfig *models.Pconfig) error
- func (s *DashCore) XAuth() string
- type Overview
- type ProxyStats
- type RedisStats
- type Stats
Constants ¶
View Source
const DefaultConfig = `` /* 708-byte string literal not displayed */
View Source
const MaxSlotNum = models.MaxSlotNum
Variables ¶
View Source
var AdminKey = "user_token"
View Source
var ErrClosedDashCore = errors.New("use of closed dashcore")
View Source
var ErrInitGroupID = errors.New("group id is zero")
View Source
var ErrNotOnline = errors.New("DashCore is not online")
View Source
var NeedLoginErr = errors.New("need login first")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { CoordinatorName string `toml:"coordinator_name" json:"coordinator_name"` CoordinatorAddr string `toml:"coordinator_addr" json:"coordinator_addr"` CoordinatorAuth string `toml:"coordinator_auth" json:"coordinator_auth"` AdminAddr string `toml:"admin_addr" json:"admin_addr"` AdminModel string `toml:"admin_model" json:"admin_model"` HostAdmin string `toml:"-" json:"-"` ReadCrossCloud int `toml:"read_cross_cloud" json:"read_cross_cloud"` ProductName string `toml:"product_name" json:"product_name"` ProductAuth string `toml:"product_auth" json:"product_auth"` Database DBConfig `toml:"database"` }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) LoadFromFile ¶
type DashCore ¶
type DashCore struct {
// contains filtered or unexported fields
}
func (*DashCore) AdminLogin ¶
func (*DashCore) AdminModel ¶
func (s *DashCore) AdminModel() AdminModel
func (*DashCore) ChangeServerRole ¶
func (*DashCore) CreateGroup ¶
func (*DashCore) CreateProxy ¶
func (*DashCore) DeraftAllGroup ¶
func (*DashCore) EnableReplicaGroups ¶
func (*DashCore) EnableReplicaGroupsAll ¶
func (*DashCore) GetClusterMembership ¶
func (*DashCore) GetLoginAdmin ¶
func (*DashCore) GetNodeHostInfo ¶
func (*DashCore) GetPConfigList ¶
func (*DashCore) GroupAddServer ¶
func (*DashCore) GroupDelServer ¶
func (*DashCore) GroupMountOrOfflineNode ¶
func (*DashCore) GroupPromoteServer ¶
func (*DashCore) InitDefaultPconfig ¶
func (s *DashCore) InitDefaultPconfig()
func (*DashCore) InverseReplicaGroupsAll ¶
func (*DashCore) LogCompactGroup ¶
func (*DashCore) OnlineProxy ¶
func (*DashCore) ProcessSlotAction ¶
func (*DashCore) ReRaftGroup ¶
func (*DashCore) ReadCrossCloud ¶
func (*DashCore) RefreshProxyStats ¶
func (*DashCore) RefreshRedisStats ¶
func (*DashCore) ReinitProxy ¶
func (*DashCore) RemoveAdmin ¶
func (*DashCore) RemoveGroup ¶
func (*DashCore) RemovePConfig ¶
func (*DashCore) ResyncAllPconfig ¶
func (*DashCore) ResyncGroup ¶
func (*DashCore) ResyncGroupAll ¶
func (*DashCore) ResyncOnePconfig ¶
func (*DashCore) SetSlotActionDisabled ¶
func (*DashCore) SlotActionComplete ¶
func (*DashCore) SlotActionMigratingMinIndex ¶
func (*DashCore) SlotActionPrepareFilter ¶
func (*DashCore) SlotCreateActionInit ¶
func (*DashCore) SlotCreateActionRange ¶
func (*DashCore) SlotCreateActionSome ¶
func (*DashCore) SlotRemoveAction ¶
func (*DashCore) SlotsAssignGroup ¶
func (s *DashCore) SlotsAssignGroup(slots []*models.SlotMapping) error
func (*DashCore) SlotsAssignOffline ¶
func (s *DashCore) SlotsAssignOffline(slots []*models.SlotMapping) error
func (*DashCore) SlotsRebalance ¶
func (*DashCore) SyncCreateAction ¶
func (*DashCore) SyncRemoveAction ¶
func (*DashCore) UpdateDepartment ¶
type ProxyStats ¶
type RedisStats ¶
type Stats ¶
type Stats struct { Closed bool `json:"closed"` ReadCrossCloud bool `json:"read_cross_cloud"` Slots []*models.SlotMapping `json:"slots"` Group struct { Models []*models.Group `json:"models"` Stats map[string]*RedisStats `json:"stats"` } `json:"group"` Proxy struct { Models []*models.Proxy `json:"models"` Stats map[string]*ProxyStats `json:"stats"` } `json:"proxy"` SlotAction struct { Disabled bool `json:"disabled"` Progress struct { Status string `json:"status"` } `json:"progress"` Executor int64 `json:"executor"` } `json:"slot_action"` GroupSyncStats []string `json:"group_sync_stats"` }
Click to show internal directories.
Click to hide internal directories.