ЛР 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
+29
View File
@@ -0,0 +1,29 @@
package service
import (
"context"
"gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/domain"
)
type UsersService interface {
Register(ctx context.Context, username, displayName, password string) (domain.User, error)
Me(ctx context.Context, callerID string) (domain.User, error)
}
type ChatsService interface {
Create(ctx context.Context, callerID, title string, memberIDs []string) (domain.Chat, error)
Get(ctx context.Context, callerID, chatID string) (domain.Chat, error)
List(ctx context.Context, callerID, cursor string, limit int) (domain.Page[domain.Chat], error)
}
type MessagesService interface {
Send(ctx context.Context, callerID, chatID, text string) (domain.Message, error)
List(ctx context.Context, callerID, chatID, cursor string, limit int) (domain.Page[domain.Message], error)
}
type AuthService interface {
Login(ctx context.Context, username, password string) (domain.Session, error)
Authenticate(ctx context.Context, token string) (userID string, err error)
Logout(ctx context.Context, token string) error
}