Documentation
¶
Index ¶
- type CreateUserInput
- type UpdateUserInput
- type UpdateUserPasswordInput
- type User
- type UserHandler
- func (uh *UserHandler) Create(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) GetMany(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) GetOne(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) Update(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) UpdatePassword(w http.ResponseWriter, r *http.Request)
- type UserOutput
- type UserRepository
- func (ur *UserRepository) Create(ctx context.Context, user *User) (*User, error)
- func (ur *UserRepository) Delete(ctx context.Context, id int) error
- func (ur *UserRepository) GetMany(ctx context.Context) ([]*User, error)
- func (ur *UserRepository) GetOne(ctx context.Context, id int) (*User, error)
- func (ur *UserRepository) Update(ctx context.Context, user *User) (*User, error)
- func (ur *UserRepository) UpdatePassword(ctx context.Context, user *User) (*User, error)
- type UserService
- func (us *UserService) Create(ctx context.Context, user *User) (*User, error)
- func (us *UserService) Delete(ctx context.Context, id int) error
- func (us *UserService) GetMany(ctx context.Context) ([]*User, error)
- func (us *UserService) GetOne(ctx context.Context, id int) (*User, error)
- func (us *UserService) Update(ctx context.Context, user *User) (*User, error)
- func (us *UserService) UpdatePassword(ctx context.Context, user *User) (*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserInput ¶
type CreateUserInput struct { Name string `json:"name"` Email string `json:"email"` Password string `json:"password,omitempty"` RoleId int `json:"role_id,string"` }
func (*CreateUserInput) User ¶
func (cu *CreateUserInput) User() *User
type UpdateUserInput ¶
type UpdateUserInput struct { Id int `json:"id,string"` Name string `json:"name"` Email string `json:"email"` RoleId int `json:"role_id,string"` }
func (*UpdateUserInput) User ¶
func (cu *UpdateUserInput) User() *User
type UpdateUserPasswordInput ¶
func (*UpdateUserPasswordInput) User ¶
func (pu *UpdateUserPasswordInput) User() *User
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶
func NewUserHandler(userService *UserService, roleService *role.RoleService) *UserHandler
func (*UserHandler) Create ¶
func (uh *UserHandler) Create(w http.ResponseWriter, r *http.Request)
func (*UserHandler) Delete ¶
func (uh *UserHandler) Delete(w http.ResponseWriter, r *http.Request)
func (*UserHandler) GetMany ¶
func (uh *UserHandler) GetMany(w http.ResponseWriter, r *http.Request)
func (*UserHandler) GetOne ¶
func (uh *UserHandler) GetOne(w http.ResponseWriter, r *http.Request)
func (*UserHandler) Update ¶
func (uh *UserHandler) Update(w http.ResponseWriter, r *http.Request)
func (*UserHandler) UpdatePassword ¶
func (uh *UserHandler) UpdatePassword(w http.ResponseWriter, r *http.Request)
type UserOutput ¶
type UserOutput struct { Id int `json:"id,string"` Name string `json:"name"` Email string `json:"email"` Role *role.RoleOutput `json:"role"` }
func NewUserOutput ¶
func NewUserOutput(user *User) *UserOutput
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(dbPath string) *UserRepository
func (*UserRepository) GetMany ¶
func (ur *UserRepository) GetMany(ctx context.Context) ([]*User, error)
func (*UserRepository) UpdatePassword ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(repo *UserRepository) *UserService
func (*UserService) UpdatePassword ¶
Click to show internal directories.
Click to hide internal directories.