user

package
v0.0.0-...-1bf48be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

type UpdateUserPasswordInput struct {
	Id       int    `json:"id,string"`
	Password string `json:"password"`
}

func (*UpdateUserPasswordInput) User

func (pu *UpdateUserPasswordInput) User() *User

type User

type User struct {
	Id       int
	Name     string
	Email    string
	Password string
	Role     *role.Role
}

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) Create

func (ur *UserRepository) Create(ctx context.Context, user *User) (*User, error)

func (*UserRepository) Delete

func (ur *UserRepository) Delete(ctx context.Context, id int) error

func (*UserRepository) GetMany

func (ur *UserRepository) GetMany(ctx context.Context) ([]*User, error)

func (*UserRepository) GetOne

func (ur *UserRepository) GetOne(ctx context.Context, id int) (*User, error)

func (*UserRepository) Update

func (ur *UserRepository) Update(ctx context.Context, user *User) (*User, error)

func (*UserRepository) UpdatePassword

func (ur *UserRepository) UpdatePassword(ctx context.Context, user *User) (*User, error)

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(repo *UserRepository) *UserService

func (*UserService) Create

func (us *UserService) Create(ctx context.Context, user *User) (*User, error)

func (*UserService) Delete

func (us *UserService) Delete(ctx context.Context, id int) error

func (*UserService) GetMany

func (us *UserService) GetMany(ctx context.Context) ([]*User, error)

func (*UserService) GetOne

func (us *UserService) GetOne(ctx context.Context, id int) (*User, error)

func (*UserService) Update

func (us *UserService) Update(ctx context.Context, user *User) (*User, error)

func (*UserService) UpdatePassword

func (us *UserService) UpdatePassword(ctx context.Context, user *User) (*User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL