(ctx context.Context, req *gstring.DecrByRequest)
| 225 | } |
| 226 | |
| 227 | func (s *str) DecrBy(ctx context.Context, req *gstring.DecrByRequest) (*gstring.DecrByResponse, error) { |
| 228 | err := s.dbs.DecrBy(req.Key, int(req.Amount), req.Expire*1000) |
| 229 | if err != nil { |
| 230 | return &gstring.DecrByResponse{}, err |
| 231 | } |
| 232 | return &gstring.DecrByResponse{Ok: true}, nil |
| 233 | } |
| 234 | |
| 235 | func (s *str) Exists(ctx context.Context, req *gstring.ExistsRequest) (*gstring.ExistsResponse, error) { |
| 236 | exists, err := s.dbs.Exists(req.Key) |