Exemple #1
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     subName,
     key.ToBulkString(factory),
     groupName.ToBulkString(factory)
 };
Exemple #2
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     subName,
     factory.Utf8(parameter),
     factory.Utf8(value)
 };
Exemple #3
0
            public override IEnumerable <BulkString> Request(BulkStringFactory factory)
            {
                yield return(name);

                yield return(group);

                yield return(groupName.ToBulkString(factory));

                yield return(consumerName.ToBulkString(factory));

                foreach (var argument in count.Arguments(factory))
                {
                    yield return(argument);
                }

                if (mode == Mode.NotRequireAcknowledgment)
                {
                    yield return(noAck);
                }

                yield return(streamsArgument);

                foreach (var key in streams)
                {
                    yield return(key.ToBulkString(factory));
                }

                for (var i = 0; i < streams.Count; i++)
                {
                    yield return(greaterThan);
                }
            }
Exemple #4
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     interval.Min.ToBulkString(factory),
     interval.Max.ToBulkString(factory)
 };
Exemple #5
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     start.ToBulkString(factory),
     stop.ToBulkString(factory)
 };
Exemple #6
0
        public override IEnumerable <BulkString> Request(BulkStringFactory factory)
        {
            yield return(name);

            yield return(key.ToBulkString(factory));

            if (interval.EndInclusive == Id.Maximum)
            {
                yield return(RangeConstants.Maximum);
            }
            else
            {
                yield return(interval.EndInclusive.ToBulkString(factory, Id.Print.SkipMaximalLow));
            }

            if (interval.StartInclusive == Id.Minimum)
            {
                yield return(RangeConstants.Minimum);
            }
            else
            {
                yield return(interval.StartInclusive.ToBulkString(factory, Id.Print.SkipMinimalLow));
            }

            foreach (var argument in count.Arguments(factory))
            {
                yield return(argument);
            }
        }
Exemple #7
0
        public override IEnumerable <BulkString> Request(BulkStringFactory factory)
        {
            yield return(name);

            yield return(key.ToBulkString(factory));

            yield return(value);

            foreach (var argument in expiration.Arguments(factory))
            {
                yield return(argument);
            }

            switch (condition)
            {
            case Condition.SetOnlyIfKeyDoesNotExists:
                yield return(notExists);

                break;

            case Condition.SetOnlyIfKeyExists:
                yield return(alreadyExists);

                break;
            }
        }
Exemple #8
0
        public override IEnumerable <BulkString> Request(BulkStringFactory factory)
        {
            yield return(name);

            yield return(key.ToBulkString(factory));

            foreach (var argument in by.Arguments(factory))
            {
                yield return(argument);
            }

            if (limit is { } value)
            {
                yield return(limitArgument);

                yield return(factory.Create(value.Offset));

                yield return(factory.Create(value.Count));
            }

            foreach (var argument in select.Arguments(factory))
            {
                yield return(argument);
            }

            if (order == Order.Descending)
            {
                yield return(descendingArgument);
            }

            if (mode == Mode.Alphabetical)
            {
                yield return(alphabeticalArgument);
            }
        }
Exemple #9
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory)
 {
     return((start, end) switch
     {
         (_, { } endValue) => new[]
         {
             name,
             key.ToBulkString(factory),
             Bit,
             start.ToBulkString(factory),
             endValue.ToBulkString(factory)
         },
         (var startValue, null)when startValue == Index.Start => new[]
         {
             name,
             key.ToBulkString(factory),
             Bit
         },
         _ => new[]
         {
             name,
             key.ToBulkString(factory),
             Bit,
             start.ToBulkString(factory)
         }
     });
Exemple #10
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory)
 {
     return(new PrefixedList <BulkString>(
                name,
                new KeyList(factory, keys)
                ));
 }
Exemple #11
0
            public override IEnumerable <BulkString> Request(BulkStringFactory factory)
            {
                yield return(Name);

                yield return(key.ToBulkString(factory));

                yield return(factory.Create(location.Longitude));

                yield return(factory.Create(location.Latitude));

                yield return(factory.Create(radius.Value));

                yield return(radius.Unit.ToBulkString());

                if (count is { } value)
                {
                    yield return(factory.Create(value));
                }

                if (storingMode == StoringMode.WithRawGeohash)
                {
                    yield return(Store);
                }
                else
                {
                    yield return(StoreDistance);
                }

                yield return(target.ToBulkString(factory));
            }
Exemple #12
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     field,
     value
 };
Exemple #13
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     source.ToBulkString(factory),
     destination.ToBulkString(factory),
     timeout.ToBulkString(factory)
 };
Exemple #14
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new ConcatList <BulkString>(
     prefix,
     new ProjectingReadOnlyList <Sha1, BulkString>(
         hashes,
         sha1 => factory.Create(sha1)
         )
     );
Exemple #15
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     factory.Create(seconds),
     value
 };
Exemple #16
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     not,
     destination.ToBulkString(factory),
     argument.ToBulkString(factory)
 };
Exemple #17
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     range.StartInclusive.ToBulkString(factory),
     range.EndInclusive.ToBulkString(factory)
 };
Exemple #18
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     index.ToBulkString(factory),
     element
 };
Exemple #19
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     field,
     factory.Create(increment)
 };
Exemple #20
0
 public                                  BulkString[] Arguments(BulkStringFactory factory)
 {
     return(mode switch
     {
         Mode.Strict => new[] { maxlen, factory.Create(Count) },
         _ => new[] { maxlen, approximately, factory.Create(Count) }
     });
Exemple #21
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new ConcatList <BulkString>(
     new[]
 {
     name,
     destination.ToBulkString(factory)
 },
     new KeyList(factory, sources)
     );
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     range.StartInclusive.ToBulkString(factory),
     range.EndInclusive.ToBulkString(factory),
     ZRANGE.WITHSCORES.withscores
 };
Exemple #23
0
                public override IEnumerable <BulkString> Arguments(BulkStringFactory factory)
                {
                    yield return(addressArgument);

                    var address = $"{endPoint.Address}:{endPoint.Port.ToString(CultureInfo.InvariantCulture)}";

                    yield return(factory.Utf8(address));
                }
Exemple #24
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new ConcatList <BulkString>(
     new[]
 {
     name,
     key.ToBulkString(factory)
 },
     values
     );
Exemple #25
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => type == Type.All
     ? simpleRequest
     : new[]
 {
     name,
     subName,
     typeOption,
     TypeArgument
 };
Exemple #26
0
                public override IEnumerable <BulkString> Arguments(BulkStringFactory factory)
                {
                    foreach (var pattern in patterns)
                    {
                        yield return(get);

                        yield return(factory.Utf8(pattern));
                    }
                }
Exemple #27
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory)
 {
     return(new PrefixedList <BulkString>(
                name,
                new ProjectingReadOnlyList <Channel, BulkString>(
                    channels,
                    channel => factory.Utf8(channel.Name)
                    )
                ));
 }
Exemple #28
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new PrefixedList <BulkString>(
     name,
     new KeyList(
         factory,
         new PrefixedList <Key>(
             minuend,
             subtrahends
             )
         )
     );
Exemple #29
0
 public override IEnumerable <BulkString> Request(BulkStringFactory factory) => new[]
 {
     name,
     key.ToBulkString(factory),
     where == Where.BEFORE
         ? before
         : after,
     pivot,
     element
 };
Exemple #30
0
        public override IEnumerable <BulkString> Request(BulkStringFactory factory)
        {
            yield return(name);

            yield return(key.ToBulkString(factory));

            foreach (var entryId in entryIds)
            {
                yield return(entryId.ToBulkString(factory, Id.Print.Full));
            }
        }