Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetterFunc ¶
GetterFunc 是接口型函数
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group 是核心结构。负责与外部交互
func (*Group) RegisterPeers ¶
func (g *Group) RegisterPeers(peers PeerPicker)
type HTTPPool ¶
type HTTPPool struct {
// contains filtered or unexported fields
}
HTTPPool 基于 HTTP 协议建立分布式缓存中<节点间通信>
func NewHTTPPool ¶
func (*HTTPPool) PickPeer ¶
func (p *HTTPPool) PickPeer(key string) (PeerGetter, bool)
PickPeer 根据 key 和一致性哈希选择兄弟节点,返回与该节点通信的客户端
type PeerGetter ¶
分布式缓存的目的是不同key缓存在不同的节点上,增加总的吞吐量
type PeerPicker ¶
type PeerPicker interface {
PickPeer(string) (PeerGetter, bool)
}
Click to show internal directories.
Click to hide internal directories.