Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CreateUserPayload ¶
type CreateUserPayload struct { Email string `json:"email"` Name string `json:"name"` Password string `json:"password"` }
func (CreateUserPayload) Validate ¶
func (p CreateUserPayload) Validate() error
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CreateUser ¶
func (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request)
type LoginPayload ¶
func (LoginPayload) Validate ¶
func (p LoginPayload) Validate() error
type Repository ¶
type Repository interface { Create(ctx context.Context, user *User) (*User, error) GetByEmail(ctx context.Context, email string) (*User, error) GetByID(ctx context.Context, id uint64) (*User, error) }
func NewRepository ¶
func NewRepository(db *db.DB) Repository
type Service ¶
type Service interface { Create(ctx context.Context, req CreateUserPayload) (*UserResponse, error) Login(ctx context.Context, req LoginPayload) (*UserResponse, error) }
func NewService ¶
func NewService(repository Repository) Service
type UserResponse ¶
Click to show internal directories.
Click to hide internal directories.