public None( RedisTargetInfo targetInfo, RedisCommandInfo commandInfo) { TargetInfo = targetInfo; CommandInfo = commandInfo; }
public static RedisResultInfo MapResult( RedisTargetInfo targetInfo, RedisBatchInfo batchInfo, RedisCommandInfo commandInfo, object result) { switch (result) { case string str: return(new Simple(targetInfo, commandInfo, str)); case long l: return(new Integer(targetInfo, commandInfo, l)); case int i: return(new Integer(targetInfo, commandInfo, i)); case byte[] bytes: return(new Bulk(targetInfo, commandInfo, bytes)); case object[] array: return(new TransactionBulk(targetInfo, batchInfo, commandInfo, array)); default: return(new None(targetInfo, commandInfo)); } }
public Integer( RedisTargetInfo targetInfo, RedisCommandInfo commandInfo, long value) { TargetInfo = targetInfo; CommandInfo = commandInfo; Value = value; }
public Error( RedisTargetInfo targetInfo, RedisCommandInfo commandInfo, RedisException exception) { TargetInfo = targetInfo; CommandInfo = commandInfo; Exception = exception; }
public Simple( RedisTargetInfo targetInfo, RedisCommandInfo commandInfo, string status) { TargetInfo = targetInfo; CommandInfo = commandInfo; Status = status; }
public Bulk( RedisTargetInfo targetInfo, RedisCommandInfo commandInfo, byte[] bytes) { TargetInfo = targetInfo; CommandInfo = commandInfo; Bytes = bytes; }
public MultiBulk( RedisTargetInfo targetInfo, RedisCommandInfo commandInfo, object[] array) { TargetInfo = targetInfo; CommandInfo = commandInfo; Array = array.Select(item => MapResult(targetInfo, commandInfo, item)) .ToArray(); }
public TransactionBulk( RedisTargetInfo targetInfo, RedisBatchInfo batchInfo, RedisCommandInfo commandInfo, object[] array) { TargetInfo = targetInfo; BatchInfo = batchInfo; CommandInfo = commandInfo; var commandInfos = batchInfo.CommandInfos.SkipWhile(c => !c.IsMulti) .Skip(1) .ToArray(); Array = array.Select((item, i) => MapResult(targetInfo, i < commandInfos.Length ? commandInfos[i] : null, item)) .ToArray(); }