Files
mtusi2026lab3/app/internal/service/service.go
T
2026-11-05 17:56:30 +03:00

30 lines
1.1 KiB
Go

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, idempotencyKey, 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
}