Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroyGroup ¶
func DestroyGroup(name string)
Types ¶
type ByteView ¶
type ByteView struct {
// contains filtered or unexported fields
}
ByteView 只读的字节视图,用于缓存数据
type ClientPicker ¶ added in v0.2.0
type ClientPicker struct {
// contains filtered or unexported fields
}
func NewClientPicker ¶ added in v0.2.0
func NewClientPicker(self string, opts ...PickerOptions) *ClientPicker
func (*ClientPicker) Log ¶ added in v0.2.0
func (s *ClientPicker) Log(format string, path ...interface{})
Log info
func (*ClientPicker) PickPeer ¶ added in v0.2.0
func (s *ClientPicker) PickPeer(key string) (PeerGetter, bool)
PickPeer pick a peer with the consistenthash algorithm
type GetterFunc ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) RegisterPeers ¶
func (g *Group) RegisterPeers(peers PeerPicker)
type PeerGetter ¶
PeerGetter must be implemented by a peer
type PeerPicker ¶
type PeerPicker interface {
PickPeer(key string) (peer PeerGetter, ok bool)
}
PeerPicker must be implemented to locate the peer that owns a specific key
type PickerOptions ¶ added in v0.2.0
type PickerOptions func(*ClientPicker)
func PickerServiceName ¶ added in v0.2.0
func PickerServiceName(serviceName string) PickerOptions
type Server ¶
type Server struct { pb.UnimplementedGroupCacheServer // contains filtered or unexported fields }
type ServerOptions ¶ added in v0.2.0
type ServerOptions func(*Server)
func ServiceName ¶ added in v0.2.0
func ServiceName(sname string) ServerOptions
Click to show internal directories.
Click to hide internal directories.