Esempio n. 1
0
    public static int RvExtension(StringBuilder output, int outputSize,
                                  [MarshalAs(UnmanagedType.LPStr)] string function)
    {
        switch (function)
        {
        case "Connect":
            bool Connection = RedisController.RedisConnect();
            if (Connection)
            {
                output.Append("Connected");
                return(0);
            }
            else
            {
                output.Append(RedisController.ErrorMessage);
                return(1);
            }

        case "Scan":
            if (RedisController.Connected)
            {
                output.Append(SQFUtil.SQFConvert(RedisController.RedisScan()));
            }
            return(0);

        case "Version":
            output.Append(Version);
            break;
        }
        return(0);
    }
Esempio n. 2
0
 public static string ZRangeByScore(string[] args)
 {
     string[] output = null;
     if (args.Length == 8)
     {
         output = RedisController.RedisZRangeByScore(args[0], double.Parse(args[1]), double.Parse(args[2]), bool.Parse(args[3]), bool.Parse(args[4]), bool.Parse(args[5]), long.Parse(args[6]), long.Parse(args[7]));
     }
     else if (args.Length == 7)
     {
         output = RedisController.RedisZRangeByScore(args[0], double.Parse(args[1]), double.Parse(args[2]), bool.Parse(args[3]), bool.Parse(args[4]), bool.Parse(args[5]), long.Parse(args[6]));
     }
     else if (args.Length == 6)
     {
         output = RedisController.RedisZRangeByScore(args[0], double.Parse(args[1]), double.Parse(args[2]), bool.Parse(args[3]), bool.Parse(args[4]), bool.Parse(args[5]));
     }
     else if (args.Length == 5)
     {
         output = RedisController.RedisZRangeByScore(args[0], double.Parse(args[1]), double.Parse(args[2]), bool.Parse(args[3]), bool.Parse(args[4]));
     }
     else if (args.Length == 4)
     {
         output = RedisController.RedisZRangeByScore(args[0], double.Parse(args[1]), double.Parse(args[2]), bool.Parse(args[3]));
     }
     else
     {
         output = RedisController.RedisZRangeByScore(args[0], double.Parse(args[1]), double.Parse(args[2]));
     }
     return(SQFUtil.SQFConvert(output));
 }
Esempio n. 3
0
 public static string ZRange(string[] args)
 {
     string[] output = null;
     if (args.Length == 4)
     {
         output = RedisController.RedisZRange(args[0], long.Parse(args[1]), long.Parse(args[2]), bool.Parse(args[3]));
     }
     else
     {
         output = RedisController.RedisZRange(args[0], long.Parse(args[1]), long.Parse(args[2]));
     }
     return(SQFUtil.SQFConvert(output));
 }
Esempio n. 4
0
 public static string Scan(string[] args)
 {
     string[] output = null;
     if (args.Length == 2)
     {
         output = RedisController.RedisScan(int.Parse(args[0]), args[1]);
     }
     else if (args.Length == 3)
     {
         output = RedisController.RedisScan(int.Parse(args[0]), args[1], long.Parse(args[2]));
     }
     else
     {
         output = RedisController.RedisScan(int.Parse(args[0]));
     }
     return(SQFUtil.SQFConvert(output));
 }
Esempio n. 5
0
 public static string ZScan(string[] args)
 {
     Tuple <string, double>[] tuples = null;
     if (args.Length == 4)
     {
         tuples = RedisController.RedisZScan(args[0], int.Parse(args[1]), args[2], long.Parse(args[4]));
     }
     else if (args.Length == 3)
     {
         tuples = RedisController.RedisZScan(args[0], int.Parse(args[1]), args[2]);
     }
     else
     {
         tuples = RedisController.RedisZScan(args[0], int.Parse(args[1]));
     }
     return(SQFUtil.SQFConvert(tuples.ToDictionary(x => x.Item1, x => x.Item2.ToString()), false));
 }
Esempio n. 6
0
 public static object HScan(string[] args)
 {
     if (args.Length < 2)
     {
         return(0);
     }                                  //Min of 2 args
     Tuple <string, string>[] scan = null;
     if (args.Length == 4)
     {
         scan = RedisController.RedisHScan(args[0].Trim('"'), int.Parse(args[1].Trim('"')), args[2].Trim('"'), int.Parse(args[3]));
     }
     else if (args.Length == 3)
     {
         scan = RedisController.RedisHScan(args[0].Trim('"'), int.Parse(args[1].Trim('"')), args[2].Trim('"'));
     }
     else
     {
         scan = RedisController.RedisHScan(args[0].Trim('"'), int.Parse(args[1].Trim('"')));
     }
     return(SQFUtil.SQFConvert(scan.ToDictionary(x => x.Item1, x => x.Item2)));
 }
Esempio n. 7
0
 public static string MGet(string[] args)
 {
     return(SQFUtil.SQFConvert(RedisController.RedisMGet(args)));
 }
Esempio n. 8
0
 public static string Keys(string[] args)
 {
     return(SQFUtil.SQFConvert(RedisController.RedisKeys(args[0])));
 }
Esempio n. 9
0
 public static string HGetAll(string[] args)
 {
     return(SQFUtil.SQFConvert(RedisController.RedisHGetAll(args[0].Trim('"'))));
 }
Esempio n. 10
0
 public static string SMembers(string[] args)
 {
     return(SQFUtil.SQFConvert(RedisController.RedisSMembers(args[0]), false));
 }
Esempio n. 11
0
 public static string LRange(string[] args)
 {
     return(SQFUtil.SQFConvert(RedisController.RedisLRange(args[0], long.Parse(args[1]), long.Parse(args[2]))));
 }