(ctx context.Context, req *gstring.IncrByRequest)
| 201 | } |
| 202 | |
| 203 | func (s *str) IncrBy(ctx context.Context, req *gstring.IncrByRequest) (*gstring.IncrByResponse, error) { |
| 204 | err := s.dbs.IncrBy(req.Key, int(req.Amount), req.Expire*1000) |
| 205 | if err != nil { |
| 206 | return &gstring.IncrByResponse{}, err |
| 207 | } |
| 208 | return &gstring.IncrByResponse{Ok: true}, nil |
| 209 | } |
| 210 | |
| 211 | func (s *str) IncrByFloat(ctx context.Context, req *gstring.IncrByFloatRequest) (*gstring.IncrByFloatResponse, error) { |
| 212 | err := s.dbs.IncrByFloat(req.Key, req.Amount, req.Expire*1000) |