(ctx context.Context)
| 78 | } |
| 79 | |
| 80 | func (p *Put) Command(ctx context.Context) *redis.StatusCmd { |
| 81 | var args []interface{} |
| 82 | args = append(args, DMap.Put) |
| 83 | args = append(args, p.DMap) |
| 84 | args = append(args, p.Key) |
| 85 | args = append(args, p.Value) |
| 86 | |
| 87 | if p.EX != 0 { |
| 88 | args = append(args, "EX") |
| 89 | args = append(args, p.EX) |
| 90 | } |
| 91 | |
| 92 | if p.PX != 0 { |
| 93 | args = append(args, "PX") |
| 94 | args = append(args, p.PX) |
| 95 | } |
| 96 | |
| 97 | if p.EXAT != 0 { |
| 98 | args = append(args, "EXAT") |
| 99 | args = append(args, p.EXAT) |
| 100 | } |
| 101 | |
| 102 | if p.PXAT != 0 { |
| 103 | args = append(args, "PXAT") |
| 104 | args = append(args, p.PXAT) |
| 105 | } |
| 106 | |
| 107 | if p.NX { |
| 108 | args = append(args, "NX") |
| 109 | } |
| 110 | |
| 111 | if p.XX { |
| 112 | args = append(args, "XX") |
| 113 | } |
| 114 | |
| 115 | return redis.NewStatusCmd(ctx, args...) |
| 116 | } |
| 117 | |
| 118 | func ParsePutCommand(cmd redcon.Command) (*Put, error) { |
| 119 | if len(cmd.Args) < 4 { |
no outgoing calls