Documentation
¶
Index ¶
- type Plan
- type User
- type UsersHandler
- type UsersRepository
- func (r *UsersRepository) Create(ctx context.Context, user User) (User, error)
- func (r *UsersRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (r *UsersRepository) FindByEmail(ctx context.Context, email string) (User, error)
- func (r *UsersRepository) FindByID(ctx context.Context, id uuid.UUID) (User, error)
- func (r *UsersRepository) Update(ctx context.Context, user User) (User, error)
- type UsersService
- func (s *UsersService) Create(ctx context.Context, user User) (User, error)
- func (s *UsersService) Delete(ctx context.Context, id uuid.UUID) error
- func (s *UsersService) GetByID(ctx context.Context, id uuid.UUID) (User, error)
- func (s *UsersService) Update(ctx context.Context, user User) (User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
ID uuid.UUID `gorm:"primaryKey;type:uuid;default:gen_random_uuid()"`
Email string `gorm:"not null;unique"`
Name string `gorm:"not null"`
Plan Plan `gorm:"type:varchar(20);not null;default:'free'"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
}
type UsersHandler ¶
type UsersHandler struct{}
UsersHandler handles user-related HTTP requests.
func NewUsersHandler ¶
func NewUsersHandler() *UsersHandler
NewUsersHandler constructs a UsersHandler.
func (*UsersHandler) DeleteUser ¶
func (h *UsersHandler) DeleteUser(c *echo.Context) error
func (*UsersHandler) GetUserByID ¶
func (h *UsersHandler) GetUserByID(c *echo.Context) error
GetUserByID handles GET /users/:id (stub — not yet implemented).
func (*UsersHandler) UpdateUser ¶
func (h *UsersHandler) UpdateUser(c *echo.Context) error
UpdateUser handles PUT /users/:id (stub — not yet implemented). When implemented, the request DTO must exclude the Plan field.
type UsersRepository ¶
type UsersRepository struct {
// contains filtered or unexported fields
}
func NewUsersRepository ¶
func NewUsersRepository(db *gorm.DB) *UsersRepository
func (*UsersRepository) FindByEmail ¶
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
func NewUsersService ¶
func NewUsersService(repository repository) *UsersService
Click to show internal directories.
Click to hide internal directories.