Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ClientID int `db:"cliente_id"` ClientName string `db:"cliente_nombre"` ClientDirection string `db:"cliente_direccion"` ClienteEmail string `db:"cliente_email"` ClientePassword string `db:"cliente_password"` ClienteTelephone string `db:"cliente_telefono"` }
func (*User) ToUserResponse ¶
func (user *User) ToUserResponse() UserResponse
type UserRepository ¶
type UserRepositoryLocal ¶
type UserRepositoryLocal struct { }
func NewUserRepositoryLocal ¶
func NewUserRepositoryLocal() *UserRepositoryLocal
NewUserRepositoryLocal initializes a new instance of UserRepositoryLocal.
It takes a client parameter of type *sqlx.DB and returns an instance of UserRepository.
func (*UserRepositoryLocal) DeleteUserByID ¶
func (repo *UserRepositoryLocal) DeleteUserByID() ([]byte, error)
DeleteUserByID deletes a user from the local user repository based on the user ID. It marshals the string "User deleted" into a byte slice and returns it along with a nil error.
func (*UserRepositoryLocal) GetAllUsers ¶
func (repo *UserRepositoryLocal) GetAllUsers() ([]User, error)
GetAllUsers returns all users from the local user repository.
It does not take any parameters. It returns a slice of UserResponse and an error.
func (*UserRepositoryLocal) GetUserByID ¶
func (repo *UserRepositoryLocal) GetUserByID() (*User, error)
GetUserByID retrieves a user from the local user repository based on the user ID. It creates a new User struct with sample user data and returns a pointer to it along with a nil error.
func (*UserRepositoryLocal) UpdateUserByID ¶
func (repo *UserRepositoryLocal) UpdateUserByID() (*User, error)
UpdateUserByID updates a user in the local user repository based on the user ID. It creates a new User struct with updated sample user data and returns a pointer to it along with a nil error.