Exemplo n.º 1
0
func (s *Frontend) Get(args *api.Load, reply *api.ValueResult) error {
	var data []byte
	fmt.Printf("cli asked for %s from groupcache\n", args.Key)
	err := s.cacheGroup.Get(nil, args.Key,
		groupcache.AllocatingByteSliceSink(&data))

	reply.Value = string(data)
	return err
}
Exemplo n.º 2
0
func (s *Server) Get(args *api.Load, reply *api.ValueResult) error {
	data := s.db.Get(args.Key)
	reply.Value = string(data)
	return nil
}