Versions in this module Expand all Collapse all v0 v0.2.0 Feb 21, 2023 Changes in this version + type ClientPicker struct + func NewClientPicker(self string, opts ...PickerOptions) *ClientPicker + func (s *ClientPicker) Log(format string, path ...interface{}) + func (s *ClientPicker) PickPeer(key string) (PeerGetter, bool) + type PickerOptions func(*ClientPicker) + func PickerServiceName(serviceName string) PickerOptions + type ServerOptions func(*Server) + func ServiceName(sname string) ServerOptions v0.1.1 Feb 17, 2023 Changes in this version + func DestroyGroup(name string) + type ByteView struct + func (b ByteView) ByteSLice() []byte + func (b ByteView) Len() int + func (b ByteView) String() string + type Client struct + func NewClient(name string) (*Client, error) + func (c *Client) Get(group, key string) ([]byte, error) + type Getter interface + Get func(key string) ([]byte, error) + type GetterFunc func(key string) ([]byte, error) + func (f GetterFunc) Get(key string) ([]byte, error) + type Group struct + func GetGroup(name string) *Group + func NewGroup(name string, cacheBytes int64, getter Getter) *Group + func (g *Group) Get(key string) (ByteView, error) + func (g *Group) RegisterPeers(peers PeerPicker) + type PeerGetter interface + Get func(group string, key string) ([]byte, error) + type PeerPicker interface + PickPeer func(key string) (peer PeerGetter, ok bool) + type Server struct + func NewServer(self string) (*Server, error) + func (s *Server) Get(ctx context.Context, in *pb.Request) (*pb.Response, error) + func (s *Server) Log(format string, path ...interface{}) + func (s *Server) PickPeer(key string) (PeerGetter, bool) + func (s *Server) Self() string + func (s *Server) Set(peers ...string) + func (s *Server) SetWithReplicas(replicas int, peers ...string) + func (s *Server) Start() error + func (s *Server) Stop()