Перенеси реализацию мессенджера из ЛР 6
Источник — проверенное рабочее дерево ЛР 6 поверх 18878d6, включая изменения после повторного ревью. SHA-256 списка исходных файлов: e45a3d85b41feff1da78dce3f20fd1f4af1c5ee629e6ed703218bc8e21ad58fe.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Repository interface {
|
||||
// Create stores a new user or returns ErrUsernameTaken; the uniqueness
|
||||
// check and the insert must be atomic.
|
||||
Create(ctx context.Context, user User) error
|
||||
GetByID(ctx context.Context, id uuid.UUID) (User, error)
|
||||
GetByUsername(ctx context.Context, username string) (User, error)
|
||||
// ExistingIDs returns the subset of ids that belong to registered users,
|
||||
// in no particular order, in one round trip.
|
||||
ExistingIDs(ctx context.Context, ids []uuid.UUID) ([]uuid.UUID, error)
|
||||
}
|
||||
Reference in New Issue
Block a user