Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 92b8955

Browse files
committed
reformat RedisClient whitespace
1 parent 589b881 commit 92b8955

8 files changed

Lines changed: 903 additions & 903 deletions

src/ServiceStack.Redis/RedisClient.ICacheClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public long Decrement(string key, uint amount)
7272

7373
public bool Add<T>(string key, T value)
7474
{
75-
return Exec(r => r.Set(key, ToBytes(value), exists:false));
75+
return Exec(r => r.Set(key, ToBytes(value), exists: false));
7676
}
7777

7878
public bool Set<T>(string key, T value)
@@ -103,7 +103,7 @@ public bool Add<T>(string key, T value, DateTime expiresAt)
103103

104104
public bool Add<T>(string key, T value, TimeSpan expiresIn)
105105
{
106-
return Exec(r => r.Set(key, ToBytes(value), exists:false, expiryMs:(long)expiresIn.TotalMilliseconds));
106+
return Exec(r => r.Set(key, ToBytes(value), exists: false, expiryMs: (long)expiresIn.TotalMilliseconds));
107107
}
108108

109109
public bool Set<T>(string key, T value, TimeSpan expiresIn)
@@ -148,7 +148,7 @@ public bool Replace<T>(string key, T value, DateTime expiresAt)
148148

149149
public bool Replace<T>(string key, T value, TimeSpan expiresIn)
150150
{
151-
return Exec(r => r.Set(key, ToBytes(value), exists:true, expiryMs: (long)expiresIn.TotalMilliseconds));
151+
return Exec(r => r.Set(key, ToBytes(value), exists: true, expiryMs: (long)expiresIn.TotalMilliseconds));
152152
}
153153

154154
public IDictionary<string, T> GetAll<T>(IEnumerable<string> keys)

src/ServiceStack.Redis/RedisClient.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public string this[string key]
9595
set { SetEntry(key, value); }
9696
}
9797

98-
public override void OnConnected() {}
98+
public override void OnConnected() { }
9999

100100
public RedisText Custom(params object[] cmdWithArgs)
101101
{
@@ -167,17 +167,17 @@ public bool SetEntryIfExists(string key, string value)
167167
{
168168
var bytesValue = value != null ? value.ToUtf8Bytes() : null;
169169

170-
return base.Set(key, bytesValue, exists:true);
170+
return base.Set(key, bytesValue, exists: true);
171171
}
172172

173173
public bool SetEntryIfExists(string key, string value, TimeSpan expireIn)
174174
{
175175
var bytesValue = value != null ? value.ToUtf8Bytes() : null;
176176

177177
if (expireIn.Milliseconds > 0)
178-
return base.Set(key, bytesValue, exists:true, expiryMs:(long)expireIn.TotalMilliseconds);
178+
return base.Set(key, bytesValue, exists: true, expiryMs: (long)expireIn.TotalMilliseconds);
179179
else
180-
return base.Set(key, bytesValue, exists:true, expirySeconds:(int)expireIn.TotalSeconds);
180+
return base.Set(key, bytesValue, exists: true, expirySeconds: (int)expireIn.TotalSeconds);
181181
}
182182

183183
public bool SetEntryIfNotExists(string key, string value)
@@ -302,7 +302,7 @@ public long IncrementValueBy(string key, long count)
302302
{
303303
return IncrBy(key, count);
304304
}
305-
305+
306306
public double IncrementValueBy(string key, double count)
307307
{
308308
return IncrByFloat(key, count);
@@ -342,7 +342,7 @@ public bool ExpireEntryIn(string key, TimeSpan expireIn)
342342
return PExpire(key, (long)expireIn.TotalMilliseconds);
343343
}
344344
}
345-
345+
346346
return Expire(key, (int)expireIn.TotalSeconds);
347347
}
348348

@@ -923,7 +923,7 @@ public void RemoveByRegex(string pattern)
923923
RemoveByPattern(pattern.Replace(".*", "*").Replace(".+", "?"));
924924
}
925925

926-
public IEnumerable<string> ScanAllKeys(string pattern = null, int pageSize=1000)
926+
public IEnumerable<string> ScanAllKeys(string pattern = null, int pageSize = 1000)
927927
{
928928
var ret = new ScanResult();
929929
while (true)
@@ -999,12 +999,12 @@ public bool AddToHyperLog(string key, params string[] elements)
999999
{
10001000
return base.PfAdd(key, elements.Map(x => x.ToUtf8Bytes()).ToArray());
10011001
}
1002-
1002+
10031003
public long CountHyperLog(string key)
10041004
{
10051005
return base.PfCount(key);
10061006
}
1007-
1007+
10081008
public void MergeHyperLogs(string toKey, params string[] fromKeys)
10091009
{
10101010
base.PfMerge(toKey, fromKeys);

src/ServiceStack.Redis/RedisClient_Admin.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717

1818
namespace ServiceStack.Redis
1919
{
20-
public partial class RedisClient
21-
: IRedisClient
22-
{
20+
public partial class RedisClient
21+
: IRedisClient
22+
{
2323
public void SetConfig(string configItem, string value)
2424
{
2525
base.ConfigSet(configItem, value.ToUtf8Bytes());
2626
}
2727

28-
public RedisText GetServerRoleInfo()
29-
{
30-
return base.Role();
31-
}
28+
public RedisText GetServerRoleInfo()
29+
{
30+
return base.Role();
31+
}
3232

33-
public string GetConfig(string configItem)
33+
public string GetConfig(string configItem)
3434
{
3535
var sb = new StringBuilder();
3636
var byteArray = base.ConfigGet(configItem);
@@ -66,12 +66,12 @@ public void SetClient(string name)
6666
base.ClientSetName(name);
6767
}
6868

69-
public void KillClient(string address)
70-
{
69+
public void KillClient(string address)
70+
{
7171
base.ClientKill(address);
72-
}
72+
}
7373

74-
public long KillClients(string fromAddress = null, string withId = null, RedisClientType? ofType = null, bool? skipMe = null)
74+
public long KillClients(string fromAddress = null, string withId = null, RedisClientType? ofType = null, bool? skipMe = null)
7575
{
7676
var typeString = ofType != null ? ofType.ToString().ToLower() : null;
7777
var skipMeString = skipMe != null ? (skipMe.Value ? "yes" : "no") : null;

src/ServiceStack.Redis/RedisClient_Hash.cs

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -18,70 +18,70 @@
1818

1919
namespace ServiceStack.Redis
2020
{
21-
public partial class RedisClient
22-
: IRedisClient
23-
{
24-
public IHasNamed<IRedisHash> Hashes { get; set; }
25-
26-
internal class RedisClientHashes
27-
: IHasNamed<IRedisHash>
28-
{
29-
private readonly RedisClient client;
30-
31-
public RedisClientHashes(RedisClient client)
32-
{
33-
this.client = client;
34-
}
35-
36-
public IRedisHash this[string hashId]
37-
{
38-
get
39-
{
40-
return new RedisClientHash(client, hashId);
41-
}
42-
set
43-
{
44-
var hash = this[hashId];
45-
hash.Clear();
46-
hash.CopyTo(value.ToArray(), 0);
47-
}
48-
}
49-
}
50-
51-
public bool SetEntryInHash(string hashId, string key, string value)
52-
{
53-
return base.HSet(hashId, key.ToUtf8Bytes(), value.ToUtf8Bytes()) == Success;
54-
}
55-
56-
public bool SetEntryInHashIfNotExists(string hashId, string key, string value)
57-
{
58-
return base.HSetNX(hashId, key.ToUtf8Bytes(), value.ToUtf8Bytes()) == Success;
59-
}
60-
61-
public void SetRangeInHash(string hashId, IEnumerable<KeyValuePair<string, string>> keyValuePairs)
62-
{
63-
var keyValuePairsList = keyValuePairs.ToList();
64-
if (keyValuePairsList.Count == 0) return;
65-
66-
var keys = new byte[keyValuePairsList.Count][];
67-
var values = new byte[keyValuePairsList.Count][];
68-
69-
for (var i = 0; i < keyValuePairsList.Count; i++)
70-
{
71-
var kvp = keyValuePairsList[i];
72-
keys[i] = kvp.Key.ToUtf8Bytes();
73-
values[i] = kvp.Value.ToUtf8Bytes();
74-
}
75-
76-
base.HMSet(hashId, keys, values);
77-
}
78-
79-
public long IncrementValueInHash(string hashId, string key, int incrementBy)
21+
public partial class RedisClient
22+
: IRedisClient
23+
{
24+
public IHasNamed<IRedisHash> Hashes { get; set; }
25+
26+
internal class RedisClientHashes
27+
: IHasNamed<IRedisHash>
28+
{
29+
private readonly RedisClient client;
30+
31+
public RedisClientHashes(RedisClient client)
32+
{
33+
this.client = client;
34+
}
35+
36+
public IRedisHash this[string hashId]
37+
{
38+
get
39+
{
40+
return new RedisClientHash(client, hashId);
41+
}
42+
set
43+
{
44+
var hash = this[hashId];
45+
hash.Clear();
46+
hash.CopyTo(value.ToArray(), 0);
47+
}
48+
}
49+
}
50+
51+
public bool SetEntryInHash(string hashId, string key, string value)
52+
{
53+
return base.HSet(hashId, key.ToUtf8Bytes(), value.ToUtf8Bytes()) == Success;
54+
}
55+
56+
public bool SetEntryInHashIfNotExists(string hashId, string key, string value)
57+
{
58+
return base.HSetNX(hashId, key.ToUtf8Bytes(), value.ToUtf8Bytes()) == Success;
59+
}
60+
61+
public void SetRangeInHash(string hashId, IEnumerable<KeyValuePair<string, string>> keyValuePairs)
62+
{
63+
var keyValuePairsList = keyValuePairs.ToList();
64+
if (keyValuePairsList.Count == 0) return;
65+
66+
var keys = new byte[keyValuePairsList.Count][];
67+
var values = new byte[keyValuePairsList.Count][];
68+
69+
for (var i = 0; i < keyValuePairsList.Count; i++)
70+
{
71+
var kvp = keyValuePairsList[i];
72+
keys[i] = kvp.Key.ToUtf8Bytes();
73+
values[i] = kvp.Value.ToUtf8Bytes();
74+
}
75+
76+
base.HMSet(hashId, keys, values);
77+
}
78+
79+
public long IncrementValueInHash(string hashId, string key, int incrementBy)
8080
{
8181
return base.HIncrby(hashId, key.ToUtf8Bytes(), incrementBy);
8282
}
8383

84-
public long IncrementValueInHash(string hashId, string key, long incrementBy)
84+
public long IncrementValueInHash(string hashId, string key, long incrementBy)
8585
{
8686
return base.HIncrby(hashId, key.ToUtf8Bytes(), incrementBy);
8787
}
@@ -92,49 +92,49 @@ public double IncrementValueInHash(string hashId, string key, double incrementBy
9292
}
9393

9494
public string GetValueFromHash(string hashId, string key)
95-
{
96-
return base.HGet(hashId, key.ToUtf8Bytes()).FromUtf8Bytes();
97-
}
98-
99-
public bool HashContainsEntry(string hashId, string key)
100-
{
101-
return base.HExists(hashId, key.ToUtf8Bytes()) == Success;
102-
}
103-
104-
public bool RemoveEntryFromHash(string hashId, string key)
105-
{
106-
return base.HDel(hashId, key.ToUtf8Bytes()) == Success;
107-
}
108-
109-
public long GetHashCount(string hashId)
110-
{
111-
return base.HLen(hashId);
112-
}
113-
114-
public List<string> GetHashKeys(string hashId)
115-
{
116-
var multiDataList = base.HKeys(hashId);
117-
return multiDataList.ToStringList();
118-
}
119-
120-
public List<string> GetHashValues(string hashId)
121-
{
122-
var multiDataList = base.HVals(hashId);
123-
return multiDataList.ToStringList();
124-
}
125-
126-
public Dictionary<string, string> GetAllEntriesFromHash(string hashId)
127-
{
128-
var multiDataList = base.HGetAll(hashId);
95+
{
96+
return base.HGet(hashId, key.ToUtf8Bytes()).FromUtf8Bytes();
97+
}
98+
99+
public bool HashContainsEntry(string hashId, string key)
100+
{
101+
return base.HExists(hashId, key.ToUtf8Bytes()) == Success;
102+
}
103+
104+
public bool RemoveEntryFromHash(string hashId, string key)
105+
{
106+
return base.HDel(hashId, key.ToUtf8Bytes()) == Success;
107+
}
108+
109+
public long GetHashCount(string hashId)
110+
{
111+
return base.HLen(hashId);
112+
}
113+
114+
public List<string> GetHashKeys(string hashId)
115+
{
116+
var multiDataList = base.HKeys(hashId);
117+
return multiDataList.ToStringList();
118+
}
119+
120+
public List<string> GetHashValues(string hashId)
121+
{
122+
var multiDataList = base.HVals(hashId);
123+
return multiDataList.ToStringList();
124+
}
125+
126+
public Dictionary<string, string> GetAllEntriesFromHash(string hashId)
127+
{
128+
var multiDataList = base.HGetAll(hashId);
129129
return multiDataList.ToStringDictionary();
130-
}
131-
132-
public List<string> GetValuesFromHash(string hashId, params string[] keys)
133-
{
134-
if (keys.Length == 0) return new List<string>();
135-
var keyBytes = ConvertToBytes(keys);
136-
var multiDataList = base.HMGet(hashId, keyBytes);
137-
return multiDataList.ToStringList();
138-
}
139-
}
130+
}
131+
132+
public List<string> GetValuesFromHash(string hashId, params string[] keys)
133+
{
134+
if (keys.Length == 0) return new List<string>();
135+
var keyBytes = ConvertToBytes(keys);
136+
var multiDataList = base.HMGet(hashId, keyBytes);
137+
return multiDataList.ToStringList();
138+
}
139+
}
140140
}

0 commit comments

Comments
 (0)