chat/internal/domain/repository/matchmaking.go

20 lines
706 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package repository
import "context"
// MatchmakingRepository 定義配對相關的資料存取介面
type MatchmakingRepository interface {
// JoinQueue 加入配對佇列返回狀態和房間ID如果配對成功
JoinQueue(ctx context.Context, uid string) (status string, roomID string, err error)
// GetMatchStatus 查詢使用者的配對狀態
GetMatchStatus(ctx context.Context, uid string) (status string, roomID string, err error)
// CreateRoom 建立房間並添加成員
CreateRoom(ctx context.Context, roomID string, members []string) error
// IsRoomMember 檢查使用者是否為房間成員
IsRoomMember(ctx context.Context, roomID string, uid string) (bool, error)
}