Skip to content

Commit d29b19f

Browse files
committed
adding KeyPrefixed
1 parent dad0b17 commit d29b19f

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

src/StackExchange.Redis/KeyspaceIsolation/KeyPrefixed.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,51 @@ public Task<bool> HashDeleteAsync(RedisKey key, RedisValue hashField, CommandFla
8484
public Task<bool> HashExistsAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
8585
Inner.HashExistsAsync(ToInner(key), hashField, flags);
8686

87+
public Task<RedisValue> HashFieldGetAndDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
88+
Inner.HashFieldGetAndDeleteAsync(key, hashField, flags);
89+
90+
public Task<Lease<byte>?> HashFieldGetLeaseAndDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
91+
Inner.HashFieldGetLeaseAndDeleteAsync(key, hashField, flags);
92+
93+
public Task<RedisValue[]> HashFieldGetAndDeleteAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) =>
94+
Inner.HashFieldGetAndDeleteAsync(key, hashFields, flags);
95+
96+
public Task<RedisValue> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
97+
Inner.HashFieldGetAndSetExpiryAsync(key, hashField, expiry, persist, flags);
98+
99+
public Task<RedisValue> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
100+
Inner.HashFieldGetAndSetExpiryAsync(key, hashField, expiry, persist, flags);
101+
102+
public Task<Lease<byte>?> HashFieldGetLeaseAndSetExpiryAsync(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
103+
Inner.HashFieldGetLeaseAndSetExpiryAsync(key, hashField, expiry, persist, flags);
104+
105+
public Task<Lease<byte>?> HashFieldGetLeaseAndSetExpiryAsync(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
106+
Inner.HashFieldGetLeaseAndSetExpiryAsync(key, hashField, expiry, persist, flags);
107+
108+
public Task<RedisValue[]> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue[] hashFields, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
109+
Inner.HashFieldGetAndSetExpiryAsync(key, hashFields, expiry, persist, flags);
110+
111+
public Task<RedisValue[]> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue[] hashFields, DateTime? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
112+
Inner.HashFieldGetAndSetExpiryAsync(key, hashFields, expiry, persist, flags);
113+
114+
public Task<RedisValue> HashFieldSetAndSetExpiryAsync(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
115+
Inner.HashFieldSetAndSetExpiryAsync(key, hashField, expiry, keepTtl, when, flags);
116+
117+
public Task<RedisValue> HashFieldSetAndSetExpiryAsync(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
118+
Inner.HashFieldSetAndSetExpiryAsync(key, hashField, expiry, keepTtl, when, flags);
119+
120+
public Task<Lease<byte>?> HashFieldSetLeaseAndSetExpiryAsync(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
121+
Inner.HashFieldSetLeaseAndSetExpiryAsync(key, hashField, expiry, keepTtl, when, flags);
122+
123+
public Task<Lease<byte>?> HashFieldSetLeaseAndSetExpiryAsync(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
124+
Inner.HashFieldSetLeaseAndSetExpiryAsync(key, hashField, expiry, keepTtl, when, flags);
125+
126+
public Task<RedisValue[]> HashFieldSetAndSetExpiryAsync(RedisKey key, RedisValue[] hashFields, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
127+
Inner.HashFieldSetAndSetExpiryAsync(key, hashFields, expiry, keepTtl, when, flags);
128+
129+
public Task<RedisValue[]> HashFieldSetAndSetExpiryAsync(RedisKey key, RedisValue[] hashFields, DateTime? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
130+
Inner.HashFieldSetAndSetExpiryAsync(key, hashFields, expiry, keepTtl, when, flags);
131+
87132
public Task<ExpireResult[]> HashFieldExpireAsync(RedisKey key, RedisValue[] hashFields, TimeSpan expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) =>
88133
Inner.HashFieldExpireAsync(ToInner(key), hashFields, expiry, when, flags);
89134

src/StackExchange.Redis/KeyspaceIsolation/KeyPrefixedDatabase.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,51 @@ public bool HashDelete(RedisKey key, RedisValue hashField, CommandFlags flags =
8181
public bool HashExists(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
8282
Inner.HashExists(ToInner(key), hashField, flags);
8383

84+
public RedisValue HashFieldGetAndDelete(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
85+
Inner.HashFieldGetAndDelete(key, hashField, flags);
86+
87+
public Lease<byte>? HashFieldGetLeaseAndDelete(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
88+
Inner.HashFieldGetLeaseAndDelete(key, hashField, flags);
89+
90+
public RedisValue[] HashFieldGetAndDelete(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) =>
91+
Inner.HashFieldGetAndDelete(key, hashFields, flags);
92+
93+
public RedisValue HashFieldGetAndSetExpiry(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
94+
Inner.HashFieldGetAndSetExpiry(key, hashField, expiry, persist, flags);
95+
96+
public RedisValue HashFieldGetAndSetExpiry(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
97+
Inner.HashFieldGetAndSetExpiry(key, hashField, expiry, persist, flags);
98+
99+
public Lease<byte>? HashFieldGetLeaseAndSetExpiry(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
100+
Inner.HashFieldGetLeaseAndSetExpiry(key, hashField, expiry, persist, flags);
101+
102+
public Lease<byte>? HashFieldGetLeaseAndSetExpiry(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
103+
Inner.HashFieldGetLeaseAndSetExpiry(key, hashField, expiry, persist, flags);
104+
105+
public RedisValue[] HashFieldGetAndSetExpiry(RedisKey key, RedisValue[] hashFields, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
106+
Inner.HashFieldGetAndSetExpiry(key, hashFields, expiry, persist, flags);
107+
108+
public RedisValue[] HashFieldGetAndSetExpiry(RedisKey key, RedisValue[] hashFields, DateTime? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
109+
Inner.HashFieldGetAndSetExpiry(key, hashFields, expiry, persist, flags);
110+
111+
public RedisValue HashFieldSetAndSetExpiry(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
112+
Inner.HashFieldSetAndSetExpiry(key, hashField, expiry, keepTtl, when, flags);
113+
114+
public RedisValue HashFieldSetAndSetExpiry(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
115+
Inner.HashFieldSetAndSetExpiry(key, hashField, expiry, keepTtl, when, flags);
116+
117+
public Lease<byte>? HashFieldSetLeaseAndSetExpiry(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
118+
Inner.HashFieldSetLeaseAndSetExpiry(key, hashField, expiry, keepTtl, when, flags);
119+
120+
public Lease<byte>? HashFieldSetLeaseAndSetExpiry(RedisKey key, RedisValue hashField, DateTime? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
121+
Inner.HashFieldSetLeaseAndSetExpiry(key, hashField, expiry, keepTtl, when, flags);
122+
123+
public RedisValue[] HashFieldSetAndSetExpiry(RedisKey key, RedisValue[] hashFields, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
124+
Inner.HashFieldSetAndSetExpiry(key, hashFields, expiry, keepTtl, when, flags);
125+
126+
public RedisValue[] HashFieldSetAndSetExpiry(RedisKey key, RedisValue[] hashFields, DateTime? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
127+
Inner.HashFieldSetAndSetExpiry(key, hashFields, expiry, keepTtl, when, flags);
128+
84129
public ExpireResult[] HashFieldExpire(RedisKey key, RedisValue[] hashFields, TimeSpan expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) =>
85130
Inner.HashFieldExpire(ToInner(key), hashFields, expiry, when, flags);
86131

0 commit comments

Comments
 (0)