(ctx context.Context, in *proto.SlaveSetRequest)
| 101 | } |
| 102 | |
| 103 | func (s *Slave) Set(ctx context.Context, in *proto.SlaveSetRequest) (*proto.SlaveSetResponse, error) { |
| 104 | err := s.DB.Put([]byte(in.Key), []byte(in.Value)) |
| 105 | if err != nil { |
| 106 | return &proto.SlaveSetResponse{}, err |
| 107 | } |
| 108 | return &proto.SlaveSetResponse{Ok: true}, nil |
| 109 | } |
| 110 | |
| 111 | func (s *Slave) Del(ctx context.Context, in *proto.SlaveDelRequest) (*proto.SlaveDelResponse, error) { |
| 112 | err := s.DB.Delete([]byte(in.Key)) |