mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
internal/redis/channel.go: Change delimiter to "/"
This commit is contained in:
parent
dd9bd85801
commit
0e19f6d146
3 changed files with 6 additions and 6 deletions
|
|
@ -18,7 +18,7 @@ func (c *Channel) Append(name string) {
|
|||
}
|
||||
|
||||
func (c Channel) String() string {
|
||||
return strings.Join(c, ".")
|
||||
return strings.Join(c, "/")
|
||||
}
|
||||
|
||||
// Define channels without any variables.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ func TestChannel_String(t *testing.T) {
|
|||
want string
|
||||
}{
|
||||
{"Empty", Channel{}, ""},
|
||||
{"Alot", Channel{"one", "two", "three"}, "one.two.three"},
|
||||
{"Alot", Channel{"one", "two", "three"}, "one/two/three"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
@ -54,9 +54,9 @@ func TestActionChannel_String(t *testing.T) {
|
|||
want string
|
||||
}{
|
||||
{"Empty", fields{}, "actions"},
|
||||
{"Contract", fields{Contract: "mycontract"}, "actions.contract:mycontract"},
|
||||
{"Action", fields{Action: "myaction"}, "actions.action:myaction"},
|
||||
{"ContractAction", fields{Contract: "mycontract", Action: "myaction"}, "actions.contract:mycontract.action:myaction"},
|
||||
{"Contract", fields{Contract: "mycontract"}, "actions/contract/mycontract"},
|
||||
{"Action", fields{Action: "myaction"}, "actions/action/myaction"},
|
||||
{"ContractAction", fields{Contract: "mycontract", Action: "myaction"}, "actions/contract/mycontract/action/myaction"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ func TestKey_String(t *testing.T) {
|
|||
{"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"},
|
||||
{"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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue