Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MailRepositoryPostgres ¶
MailRepositoryPostgres represents a PostgreSQL implementation of the MailRepository interface.
func NewMailRepositoryPostgres ¶
func NewMailRepositoryPostgres(db *sql.DB) *MailRepositoryPostgres
NewMailRepositoryPostgres creates a new MailRepositoryPostgres instance.
Parameters:
- db: A pointer to a *sql.DB representing the PostgreSQL database connection.
Returns:
- A pointer to the newly created MailRepositoryPostgres instance.
func (*MailRepositoryPostgres) Create ¶
func (r *MailRepositoryPostgres) Create(mail *models.Mail) error
Create inserts a new mail into the PostgreSQL database.
Parameters:
- mail: A pointer to a Mail struct representing the mail to be inserted.
Returns:
- An error if the operation fails.
type UserRepositoryPostgres ¶
UserRepositoryPostgres represents a PostgreSQL implementation of the UserRepository interface.
func NewUserRepositoryPostgres ¶
func NewUserRepositoryPostgres(db *sql.DB) *UserRepositoryPostgres
NewUserRepositoryPostgres creates a new UserRepositoryPostgres instance.
func (*UserRepositoryPostgres) Create ¶
func (r *UserRepositoryPostgres) Create(user *models.User) error
Create inserts a new user into the PostgreSQL database.
func (*UserRepositoryPostgres) GetAllUsers ¶
func (r *UserRepositoryPostgres) GetAllUsers() ([]*models.User, error)
GetAllUsers retrieves all users from the database.
Click to show internal directories.
Click to hide internal directories.