BitFieldRO - Read-only variant of the BITFIELD command. It is like the original BITFIELD but only accepts GET subcommand and can safely be used in read-only replicas. - BitFieldRO(ctx, key, " ", " ", " "," ")
(ctx context.Context, key string, values ...interface{})
| 180 | // It is like the original BITFIELD but only accepts GET subcommand and can safely be used in read-only replicas. |
| 181 | // - BitFieldRO(ctx, key, "<Encoding0>", "<Offset0>", "<Encoding1>","<Offset1>") |
| 182 | func (c cmdable) BitFieldRO(ctx context.Context, key string, values ...interface{}) *IntSliceCmd { |
| 183 | args := make([]interface{}, 2, 2+len(values)) |
| 184 | args[0] = "BITFIELD_RO" |
| 185 | args[1] = key |
| 186 | if len(values)%2 != 0 { |
| 187 | c := NewIntSliceCmd(ctx) |
| 188 | c.SetErr(errors.New("BitFieldRO: invalid number of arguments, must be even")) |
| 189 | return c |
| 190 | } |
| 191 | for i := 0; i < len(values); i += 2 { |
| 192 | args = append(args, "GET", values[i], values[i+1]) |
| 193 | } |
| 194 | cmd := NewIntSliceCmd(ctx, args...) |
| 195 | _ = c(ctx, cmd) |
| 196 | return cmd |
| 197 | } |
nothing calls this directly
no test coverage detected