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); }
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)); }
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)); }
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)); }
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)); }
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))); }
public static string MGet(string[] args) { return(SQFUtil.SQFConvert(RedisController.RedisMGet(args))); }
public static string Keys(string[] args) { return(SQFUtil.SQFConvert(RedisController.RedisKeys(args[0]))); }
public static string HGetAll(string[] args) { return(SQFUtil.SQFConvert(RedisController.RedisHGetAll(args[0].Trim('"')))); }
public static string SMembers(string[] args) { return(SQFUtil.SQFConvert(RedisController.RedisSMembers(args[0]), false)); }
public static string LRange(string[] args) { return(SQFUtil.SQFConvert(RedisController.RedisLRange(args[0], long.Parse(args[1]), long.Parse(args[2])))); }