Documentation ¶
Index ¶
- Constants
- Variables
- type ApiClient
- func (c *ApiClient) AddSentinel(addr string) error
- func (c *ApiClient) CreateGroup(gid int) error
- func (c *ApiClient) CreateProxy(addr string) error
- func (c *ApiClient) DelSentinel(addr string, force bool) error
- func (c *ApiClient) EnableReplicaGroups(gid int, addr string, value bool) error
- func (c *ApiClient) EnableReplicaGroupsAll(value bool) error
- func (c *ApiClient) GroupAddServer(gid int, dc, addr string) error
- func (c *ApiClient) GroupDelServer(gid int, addr string) error
- func (c *ApiClient) GroupPromoteServer(gid int, addr string) error
- func (c *ApiClient) LogLevel(level log.LogLevel) error
- func (c *ApiClient) Model() (*models.Topom, error)
- func (c *ApiClient) OnlineProxy(addr string) error
- func (c *ApiClient) Overview() (*Overview, error)
- func (c *ApiClient) ReinitProxy(token string) error
- func (c *ApiClient) Reload() error
- func (c *ApiClient) RemoveGroup(gid int) error
- func (c *ApiClient) RemoveProxy(token string, force bool) error
- func (c *ApiClient) ResyncGroup(gid int) error
- func (c *ApiClient) ResyncGroupAll() error
- func (c *ApiClient) ResyncSentinels() error
- func (c *ApiClient) SetSlotActionDisabled(disabled bool) error
- func (c *ApiClient) SetSlotActionInterval(usecs int) error
- func (c *ApiClient) SetXAuth(name string)
- func (c *ApiClient) Shutdown() error
- func (c *ApiClient) SlotCreateAction(sid int, gid int) error
- func (c *ApiClient) SlotCreateActionRange(beg, end int, gid int) error
- func (c *ApiClient) SlotCreateActionSome(groupFrom, groupTo int, numSlots int) error
- func (c *ApiClient) SlotRemoveAction(sid int) error
- func (c *ApiClient) Slots() ([]*models.Slot, error)
- func (c *ApiClient) SlotsAssignGroup(slots []*models.SlotMapping) error
- func (c *ApiClient) SlotsAssignOffline(slots []*models.SlotMapping) error
- func (c *ApiClient) SlotsRebalance(confirm bool) (map[int]int, error)
- func (c *ApiClient) Stats() (*Stats, error)
- func (c *ApiClient) SyncCreateAction(addr string) error
- func (c *ApiClient) SyncRemoveAction(addr string) error
- func (c *ApiClient) XPing() error
- type Config
- type Overview
- type ProxyStats
- type RedisStats
- type Stats
- type Topom
- func (s *Topom) AddSentinel(addr string) error
- func (s *Topom) Close() error
- func (s *Topom) Config() *Config
- func (s *Topom) CreateGroup(gid int) error
- func (s *Topom) CreateProxy(addr string) error
- func (s *Topom) DelSentinel(addr string, force bool) error
- func (s *Topom) EnableReplicaGroups(gid int, addr string, value bool) error
- func (s *Topom) EnableReplicaGroupsAll(value bool) error
- func (s *Topom) GetSlotActionDisabled() bool
- func (s *Topom) GetSlotActionInterval() int
- func (s *Topom) GroupAddServer(gid int, dc, addr string) error
- func (s *Topom) GroupDelServer(gid int, addr string) error
- func (s *Topom) GroupPromoteServer(gid int, addr string) error
- func (s *Topom) IsClosed() bool
- func (s *Topom) IsOnline() bool
- func (s *Topom) Model() *models.Topom
- func (s *Topom) OnlineProxy(addr string) error
- func (s *Topom) Overview() (*Overview, error)
- func (s *Topom) ProcessSlotAction() error
- func (s *Topom) ProcessSyncAction() error
- func (s *Topom) RefreshProxyStats(timeout time.Duration) (*sync2.Future, error)
- func (s *Topom) RefreshRedisStats(timeout time.Duration) (*sync2.Future, error)
- func (s *Topom) ReinitProxy(token string) error
- func (s *Topom) Reload() error
- func (s *Topom) RemoveGroup(gid int) error
- func (s *Topom) RemoveProxy(token string, force bool) error
- func (s *Topom) ResyncGroup(gid int) error
- func (s *Topom) ResyncGroupAll() error
- func (s *Topom) ResyncSentinels() error
- func (s *Topom) SetSlotActionDisabled(value bool)
- func (s *Topom) SetSlotActionInterval(us int)
- func (s *Topom) SlotActionComplete(sid int) error
- func (s *Topom) SlotActionPrepare() (int, bool, error)
- func (s *Topom) SlotActionPrepareFilter(accept, update func(m *models.SlotMapping) bool) (int, bool, error)
- func (s *Topom) SlotCreateAction(sid int, gid int) error
- func (s *Topom) SlotCreateActionRange(beg, end int, gid int, must bool) error
- func (s *Topom) SlotCreateActionSome(groupFrom, groupTo int, numSlots int) error
- func (s *Topom) SlotRemoveAction(sid int) error
- func (s *Topom) Slots() ([]*models.Slot, error)
- func (s *Topom) SlotsAssignGroup(slots []*models.SlotMapping) error
- func (s *Topom) SlotsAssignOffline(slots []*models.SlotMapping) error
- func (s *Topom) SlotsRebalance(confirm bool) (map[int]int, error)
- func (s *Topom) Start(routines bool) error
- func (s *Topom) Stats() (*Stats, error)
- func (s *Topom) SwitchMasters(masters map[int]string) error
- func (s *Topom) SyncActionComplete(addr string, failed bool) error
- func (s *Topom) SyncActionPrepare() (string, error)
- func (s *Topom) SyncCreateAction(addr string) error
- func (s *Topom) SyncRemoveAction(addr string) error
- func (s *Topom) XAuth() string
Constants ¶
View Source
const DefaultConfig = `` /* 1214-byte string literal not displayed */
View Source
const MaxSlotNum = models.MaxSlotNum
Variables ¶
View Source
var ErrClosedTopom = errors.New("use of closed topom")
View Source
var ErrNotOnline = errors.New("topom is not online")
Functions ¶
This section is empty.
Types ¶
type ApiClient ¶
type ApiClient struct {
// contains filtered or unexported fields
}
func NewApiClient ¶
func (*ApiClient) AddSentinel ¶
func (*ApiClient) CreateGroup ¶
func (*ApiClient) CreateProxy ¶
func (*ApiClient) EnableReplicaGroups ¶
func (*ApiClient) EnableReplicaGroupsAll ¶
func (*ApiClient) GroupAddServer ¶
func (*ApiClient) GroupPromoteServer ¶
func (*ApiClient) OnlineProxy ¶
func (*ApiClient) ReinitProxy ¶
func (*ApiClient) RemoveGroup ¶
func (*ApiClient) ResyncGroup ¶
func (*ApiClient) ResyncGroupAll ¶
func (*ApiClient) ResyncSentinels ¶
func (*ApiClient) SetSlotActionDisabled ¶
func (*ApiClient) SetSlotActionInterval ¶
func (*ApiClient) SlotCreateActionRange ¶
func (*ApiClient) SlotCreateActionSome ¶
func (*ApiClient) SlotRemoveAction ¶
func (*ApiClient) SlotsAssignGroup ¶
func (c *ApiClient) SlotsAssignGroup(slots []*models.SlotMapping) error
func (*ApiClient) SlotsAssignOffline ¶
func (c *ApiClient) SlotsAssignOffline(slots []*models.SlotMapping) error
func (*ApiClient) SlotsRebalance ¶
func (*ApiClient) SyncCreateAction ¶
func (*ApiClient) SyncRemoveAction ¶
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"` HostAdmin string `toml:"-" json:"-"` ProductName string `toml:"product_name" json:"product_name"` ProductAuth string `toml:"product_auth" json:"-"` MigrationMethod string `toml:"migration_method" json:"migration_method"` MigrationParallelSlots int `toml:"migration_parallel_slots" json:"migration_parallel_slots"` MigrationAsyncMaxBulks int `toml:"migration_async_maxbulks" json:"migration_async_maxbulks"` MigrationAsyncMaxBytes bytesize.Int64 `toml:"migration_async_maxbytes" json:"migration_async_maxbytes"` MigrationAsyncNumKeys int `toml:"migration_async_numkeys" json:"migration_async_numkeys"` MigrationTimeout timesize.Duration `toml:"migration_timeout" json:"migration_timeout"` SentinelClientTimeout timesize.Duration `toml:"sentinel_client_timeout" json:"sentinel_client_timeout"` SentinelQuorum int `toml:"sentinel_quorum" json:"sentinel_quorum"` SentinelParallelSyncs int `toml:"sentinel_parallel_syncs" json:"sentinel_parallel_syncs"` SentinelDownAfter timesize.Duration `toml:"sentinel_down_after" json:"sentinel_down_after"` SentinelFailoverTimeout timesize.Duration `toml:"sentinel_failover_timeout" json:"sentinel_failover_timeout"` SentinelNotificationScript string `toml:"sentinel_notification_script" json:"sentinel_notification_script"` SentinelClientReconfigScript string `toml:"sentinel_client_reconfig_script" json:"sentinel_client_reconfig_script"` }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) LoadFromFile ¶
type ProxyStats ¶
type RedisStats ¶
type RedisStats struct { Stats map[string]string `json:"stats,omitempty"` Error *rpc.RemoteError `json:"error,omitempty"` Sentinel map[string]*redis.SentinelGroup `json:"sentinel,omitempty"` UnixTime int64 `json:"unixtime"` Timeout bool `json:"timeout,omitempty"` }
type Stats ¶
type Stats struct { Closed bool `json:"closed"` 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 { Interval int64 `json:"interval"` Disabled bool `json:"disabled"` Progress struct { Status string `json:"status"` } `json:"progress"` Executor int64 `json:"executor"` } `json:"slot_action"` HA struct { Model *models.Sentinel `json:"model"` Stats map[string]*RedisStats `json:"stats"` Masters map[string]string `json:"masters"` } `json:"sentinels"` }
type Topom ¶
type Topom struct {
// contains filtered or unexported fields
}
func (*Topom) AddSentinel ¶
func (*Topom) CreateGroup ¶
func (*Topom) CreateProxy ¶
func (*Topom) EnableReplicaGroups ¶
func (*Topom) EnableReplicaGroupsAll ¶
func (*Topom) GetSlotActionDisabled ¶
func (*Topom) GetSlotActionInterval ¶
func (*Topom) OnlineProxy ¶
func (*Topom) ProcessSlotAction ¶
func (*Topom) ProcessSyncAction ¶
func (*Topom) RefreshProxyStats ¶
func (*Topom) RefreshRedisStats ¶
func (*Topom) ReinitProxy ¶
func (*Topom) RemoveGroup ¶
func (*Topom) ResyncGroup ¶
func (*Topom) ResyncGroupAll ¶
func (*Topom) ResyncSentinels ¶
func (*Topom) SetSlotActionDisabled ¶
func (*Topom) SetSlotActionInterval ¶
func (*Topom) SlotActionComplete ¶
func (*Topom) SlotActionPrepareFilter ¶
func (*Topom) SlotCreateActionRange ¶
func (*Topom) SlotCreateActionSome ¶
func (*Topom) SlotRemoveAction ¶
func (*Topom) SlotsAssignGroup ¶
func (s *Topom) SlotsAssignGroup(slots []*models.SlotMapping) error
func (*Topom) SlotsAssignOffline ¶
func (s *Topom) SlotsAssignOffline(slots []*models.SlotMapping) error
func (*Topom) SyncActionComplete ¶
func (*Topom) SyncActionPrepare ¶
func (*Topom) SyncCreateAction ¶
func (*Topom) SyncRemoveAction ¶
Click to show internal directories.
Click to hide internal directories.