Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroryGroup ¶
func DestroryGroup(name string)
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group 提供了命名管理缓存、填充缓存的能力
func (*Group) RegisterServer ¶
RegisterServer 为 Group 注册 server
type RetrieveFunc ¶
type Retriever ¶
type Retriever interface {
// contains filtered or unexported methods
}
Retriever 要求对象实现从数据源获取数据的能力
type Server ¶
type Server struct { pb.UnimplementedGroupCacheServer Addr string // format: ip:port Status bool // true: running false: stop // contains filtered or unexported fields }
server 和 Group 是解耦合的,所以 server 要自己实现并发控制
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error)
Get 实现了 Groupcache service 的 Get 方法
Source Files
¶
Click to show internal directories.
Click to hide internal directories.