Перенести решение лабораторной 1 как основу для лабораторной 2

This commit is contained in:
2026-10-06 11:54:05 +03:00
parent 65003b6119
commit 5c3f2bfad0
54 changed files with 4472 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
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)
// ExistingIDs returns the subset of ids that belong to registered users,
// in input order, in one round trip.
ExistingIDs(ctx context.Context, ids []uuid.UUID) ([]uuid.UUID, error)
}