Перенесите реализацию ЛР 4 на стенд ЛР 5

This commit is contained in:
2026-11-18 15:33:31 +03:00
parent 276dbdad8a
commit 911d97a77a
153 changed files with 17451 additions and 1 deletions
+18
View File
@@ -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)
}