(ctx context.Context, req *gstring.IncrRequest)
| 193 | } |
| 194 | |
| 195 | func (s *str) Incr(ctx context.Context, req *gstring.IncrRequest) (*gstring.IncrResponse, error) { |
| 196 | err := s.dbs.Incr(req.Key, req.Expire*1000) |
| 197 | if err != nil { |
| 198 | return &gstring.IncrResponse{}, err |
| 199 | } |
| 200 | return &gstring.IncrResponse{Ok: true}, nil |
| 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) |