mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
internal/redis/namespace.go: Change delimiter to "::"
This commit is contained in:
parent
fb3ed0f976
commit
dd9bd85801
3 changed files with 9 additions and 9 deletions
|
|
@ -12,10 +12,10 @@ func TestKey_String(t *testing.T) {
|
|||
fields fields
|
||||
want string
|
||||
}{
|
||||
{"Empty", fields{NS: Namespace{}, Channel: Channel{}}, "ship.0000000000000000000000000000000000000000000000000000000000000000::"},
|
||||
{"Transactions", fields{NS: Namespace{ChainID: "id"}, Channel: Channel{"transactions"}}, "ship.id::transactions"},
|
||||
{"Nested", fields{NS: Namespace{ChainID: "id"}, Channel: Channel{"one.two"}}, "ship.id::one.two"},
|
||||
{"Action", fields{NS: Namespace{ChainID: "id"}, Channel: ActionChannel{Contract: "mycontract"}}, "ship.id::actions.contract:mycontract"},
|
||||
{"Empty", fields{NS: Namespace{}, Channel: Channel{}}, "ship::0000000000000000000000000000000000000000000000000000000000000000::"},
|
||||
{"Transactions", fields{NS: Namespace{ChainID: "id"}, Channel: Channel{"transactions"}}, "ship::id::transactions"},
|
||||
{"Nested", fields{NS: Namespace{ChainID: "id"}, Channel: Channel{"one.two"}}, "ship::id::one.two"},
|
||||
{"Action", fields{NS: Namespace{ChainID: "id"}, Channel: ActionChannel{Contract: "mycontract"}}, "ship::id::actions.contract.mycontract"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -41,5 +41,5 @@ func (ns Namespace) String() string {
|
|||
}
|
||||
|
||||
// Otherwise. return both.
|
||||
return strings.Join([]string{ns.Prefix, ns.ChainID}, ".")
|
||||
return strings.Join([]string{ns.Prefix, ns.ChainID}, "::")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ func TestNamespace_String(t *testing.T) {
|
|||
ns Namespace
|
||||
want string
|
||||
}{
|
||||
{"Empty", Namespace{}, "ship.0000000000000000000000000000000000000000000000000000000000000000"},
|
||||
{"Prefix Only", Namespace{Prefix: "some.prefix"}, "some.prefix.0000000000000000000000000000000000000000000000000000000000000000"},
|
||||
{"ChainID Only", Namespace{ChainID: "1234"}, "ship.1234"},
|
||||
{"Both", Namespace{Prefix: "my.prefix", ChainID: "1234"}, "my.prefix.1234"},
|
||||
{"Empty", Namespace{}, "ship::0000000000000000000000000000000000000000000000000000000000000000"},
|
||||
{"Prefix Only", Namespace{Prefix: "some.prefix"}, "some.prefix::0000000000000000000000000000000000000000000000000000000000000000"},
|
||||
{"ChainID Only", Namespace{ChainID: "1234"}, "ship::1234"},
|
||||
{"Both", Namespace{Prefix: "my.prefix", ChainID: "1234"}, "my.prefix::1234"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue