ЛР 2: PostgreSQL, сессии в Valkey, кэш истории (трек 1)

This commit is contained in:
Нурлыгаянова Екатерина
2026-10-29 11:29:38 +03:00
parent 65003b6119
commit 1503b5db81
132 changed files with 15114 additions and 20 deletions
+32
View File
@@ -0,0 +1,32 @@
package store
import (
"context"
"gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/domain"
)
type UserStore interface {
CreateUser(ctx context.Context, username, displayName, passwordHash string) (domain.User, error)
UserByID(ctx context.Context, id string) (domain.User, error)
CredentialsByUsername(ctx context.Context, username string) (domain.User, string, error)
UsernameExists(ctx context.Context, username string) bool
}
type ChatStore interface {
CreateChat(ctx context.Context, callerID, title string, memberIDs []string) (domain.Chat, error)
ChatByID(ctx context.Context, callerID, chatID string) (domain.Chat, error)
ListChats(ctx context.Context, callerID, cursor string, limit int) (domain.Page[domain.Chat], error)
}
type MessageStore interface {
AddMessage(ctx context.Context, callerID, chatID, text string) (domain.Message, error)
ListMessages(ctx context.Context, callerID, chatID, cursor string, limit int) (domain.Page[domain.Message], error)
}
type Store interface {
UserStore
ChatStore
MessageStore
}