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) 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) RemoveGroup(gid int) error
- func (c *ApiClient) RemoveProxy(token string, force bool) error
- func (c *ApiClient) ResyncGroup(gid int) 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) SlotRemoveAction(sid int) error
- func (c *ApiClient) Slots() ([]*models.Slot, error)
- func (c *ApiClient) SlotsAssignGroup(slots []*models.SlotMapping) 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) 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) RemoveGroup(gid int) error
- func (s *Topom) RemoveProxy(token string, force bool) error
- func (s *Topom) ResyncGroup(gid int) 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) SlotCreateAction(sid int, gid 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) 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 = `` /* 674-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) GroupAddServer ¶
func (*ApiClient) GroupPromoteServer ¶
func (*ApiClient) OnlineProxy ¶
func (*ApiClient) ReinitProxy ¶
func (*ApiClient) RemoveGroup ¶
func (*ApiClient) ResyncGroup ¶
func (*ApiClient) ResyncSentinels ¶
func (*ApiClient) SetSlotActionDisabled ¶
func (*ApiClient) SetSlotActionInterval ¶
func (*ApiClient) SlotCreateActionRange ¶
func (*ApiClient) SlotRemoveAction ¶
func (*ApiClient) SlotsAssignGroup ¶
func (c *ApiClient) SlotsAssignGroup(slots []*models.SlotMapping) error
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"`
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:"-"`
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"`
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) LoadFromFile ¶
type ProxyStats ¶
type RedisStats ¶
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 {
Remain int64 `json:"remain"`
Failed bool `json:"failed"`
} `json:"progress"`
Executor int64 `json:"executor"`
} `json:"slot_action"`
HA struct {
Model *models.Sentinel `json:"model"`
Stats map[string]*RedisStats `json:"stats"`
Masters map[int]string `json:"masters,omitempty"`
} `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) 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) ResyncSentinels ¶
func (*Topom) SetSlotActionDisabled ¶
func (*Topom) SetSlotActionInterval ¶
func (*Topom) SlotActionComplete ¶
func (*Topom) SlotRemoveAction ¶
func (*Topom) SlotsAssignGroup ¶
func (s *Topom) SlotsAssignGroup(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.