1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

internal/redis/namespace.go: Adding Namespace.NewKey() helper function.

This commit is contained in:
Henrik Hautakoski 2023-01-06 17:07:22 +01:00
parent 13c8ed7692
commit 1bc43cc87b

View file

@ -24,6 +24,11 @@ type Namespace struct {
ChainID string
}
// Create a new key with this namespace.
func (ns Namespace) NewKey(ch ChannelInterface) Key {
return Key{NS: ns, Channel: ch}
}
func (ns Namespace) String() string {
// No Chain id, set to "nullChain"
if len(ns.ChainID) < 1 {