20 lines
418 B
Go
20 lines
418 B
Go
package redis
|
|
|
|
import "fmt"
|
|
|
|
// MatchQueueKey 返回配對佇列的 Redis key
|
|
func MatchQueueKey() string {
|
|
return "match:queue"
|
|
}
|
|
|
|
// MatchUserKey 返回使用者配對狀態的 Redis key
|
|
func MatchUserKey(uid string) string {
|
|
return fmt.Sprintf("match:user:%s", uid)
|
|
}
|
|
|
|
// RoomMembersKey 返回房間成員的 Redis key
|
|
func RoomMembersKey(roomID string) string {
|
|
return fmt.Sprintf("room:%s:members", roomID)
|
|
}
|
|
|