Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) AddObserver(raftAddress string, nodeId int) error
- func (c *Client) AddToSlave(raftAddress string, nodeId int) error
- func (c *Client) AddWitness(raftAddress string, nodeId int) error
- func (c *Client) Close() error
- func (c *Client) ClusterInfo() (map[string]string, error)
- func (c *Client) Compact(dbType string) error
- func (c *Client) DeRaft(token string) error
- func (c *Client) DebugInfo() (map[string]string, error)
- func (c *Client) DebugInfoFull() (map[string]string, error)
- func (c *Client) Do(cmd string, args ...interface{}) (interface{}, error)
- func (c *Client) GetClusterMemberShip() (*MembershipV2, error)
- func (c *Client) GetNodeHostInfo() (string, error)
- func (c *Client) Info() (map[string]string, error)
- func (c *Client) InfoFull() (map[string]string, error)
- func (c *Client) LogCompact() error
- func (c *Client) MigrateCallback(callback_url string) error
- func (c *Client) MigrateEnd(slotId int) error
- func (c *Client) MigrateSlots(slotid int, target string) error
- func (c *Client) MigrateStatus(slotId int) ([]byte, error)
- func (c *Client) PromoteMaster() error
- func (c *Client) ReRaft(token string, port int) error
- func (c *Client) Receive() (interface{}, error)
- func (c *Client) RemoveRaftNode(nodeId int) error
- func (c *Client) Role() (string, error)
- func (c *Client) Select(database int) error
- func (c *Client) SetMaster(master string) error
- func (c *Client) ShutDown() error
- func (c *Client) Shutdown() error
- func (c *Client) SlotsInfo() (map[int]int, error)
- type InfoCache
- func (s *InfoCache) Get(addr string, force bool) (info map[string]string)
- func (s *InfoCache) GetNodeRaftInfo(addr string, iswitness bool) (*NodeInfo, error)
- func (s *InfoCache) GetProcessId(addr string) string
- func (s *InfoCache) GetRaftGroupMaster(groupId int, addrs map[string]string) (string, error)
- func (s *InfoCache) GetRaftGroupStatusInfo(groupId int, addrs map[string]string) *RaftGroupStatusInfo
- type Membership
- type MembershipV2
- type MigrateSlotAsyncOption
- type NodeInfo
- type Pool
- func (p *Pool) Cleanup() error
- func (p *Pool) Close() error
- func (p *Pool) ClusterInfo(addr string) (map[string]string, error)
- func (p *Pool) GetClient(addr string) (*Client, error)
- func (p *Pool) Info(addr string) (map[string]string, error)
- func (p *Pool) InfoFull(addr string) (map[string]string, error)
- func (p *Pool) PutClient(c *Client)
- type RaftGroupStatusInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosedPool = errors.New("use of closed redis pool")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Addr string Auth string Database int LastUse time.Time Timeout time.Duration // contains filtered or unexported fields }
func (*Client) GetClusterMemberShip ¶
func (c *Client) GetClusterMemberShip() (*MembershipV2, error)
func (*Client) GetNodeHostInfo ¶
func (*Client) LogCompact ¶
func (*Client) MigrateCallback ¶
func (*Client) MigrateEnd ¶
func (*Client) PromoteMaster ¶
func (*Client) RemoveRaftNode ¶
type InfoCache ¶
type InfoCache struct { Auth string Timeout time.Duration // contains filtered or unexported fields }
func (*InfoCache) GetNodeRaftInfo ¶
func (*InfoCache) GetProcessId ¶
func (*InfoCache) GetRaftGroupMaster ¶
func (*InfoCache) GetRaftGroupStatusInfo ¶
func (s *InfoCache) GetRaftGroupStatusInfo(groupId int, addrs map[string]string) *RaftGroupStatusInfo
type Membership ¶
type Membership struct { // ConfigChangeID is the Raft entry index of the last applied membership // change entry. ConfigChangeID uint64 `json:"config_changeid"` // Nodes is a map of NodeID values to NodeHost Raft addresses for all regular // Raft nodes. Nodes map[uint64]string `json:"nodes"` // Observers is a map of NodeID values to NodeHost Raft addresses for all // observers in the Raft cluster. Observers map[uint64]string `json:"observers"` // Witnesses is a map of NodeID values to NodeHost Raft addrsses for all // witnesses in the Raft cluster. Witnesses map[uint64]string `json:"witnesses"` // Removed is a set of NodeID values that have been removed from the Raft // cluster. They are not allowed to be added back to the cluster. Removed map[uint64]struct{} `json:"removed"` }
type MembershipV2 ¶
type MembershipV2 struct {
Info Membership `json:"info"`
}
func (*MembershipV2) CheckNodeIsRemove ¶
func (ms *MembershipV2) CheckNodeIsRemove(nodeId int) bool
func (*MembershipV2) CheckNodeIsUse ¶
func (ms *MembershipV2) CheckNodeIsUse(nodeId int) bool
func (*MembershipV2) Marshal ¶
func (ms *MembershipV2) Marshal() (string, error)
type MigrateSlotAsyncOption ¶
type NodeInfo ¶
Click to show internal directories.
Click to hide internal directories.