Add User entity and repository/hasher ports
DDavid committed on 2026-06-28 00:45 commit 5f0aa1a
internal/domain/ports.go +14 −0
+package domain
+
+import "context"
+
+type UserRepository interface {
+ Create(ctx context.Context, u *User) error
+ ByUsername(ctx context.Context, name string) (*User, error)
+ ByID(ctx context.Context, id string) (*User, error)
+}
+
+type PasswordHasher interface {
+ Hash(plain string) (string, error)
+ Compare(hash, plain string) error
+}
internal/domain/user.go +11 −0
+package domain
+
+import "time"
+
+type User struct {
+ ID int64
+ Username string
+ Email string
+ PasswordHash string
+ CreatedAt time.Time
+}