mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-19 04:50:02 +02:00
merge api/redis_common and api/redis_pubsub to api/redis
This commit is contained in:
parent
102045e47e
commit
a8bac16aa9
9 changed files with 10 additions and 15 deletions
19
api/redis/key.go
Normal file
19
api/redis/key.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package redis
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"thalos/api"
|
||||
)
|
||||
|
||||
// Key consists of a namespace and a channel.
|
||||
// And is encoded to a string in this format: `<namespace>::<channel>`
|
||||
|
||||
type Key struct {
|
||||
NS Namespace
|
||||
Channel api.Channel
|
||||
}
|
||||
|
||||
func (k Key) String() string {
|
||||
return fmt.Sprintf("%s::%s", k.NS, k.Channel.Format("/"))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue