Documentation
¶
Index ¶
- Variables
- type Interface
- type UserRepository
- func (o *UserRepository) Add(ctx context.Context, user *entity.USER) error
- func (o *UserRepository) Delete(ctx context.Context, email string) error
- func (o *UserRepository) GetAll(ctx context.Context) ([]entity.USER, error)
- func (o *UserRepository) GetOne(ctx context.Context, email string) (*entity.USER, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInternal = errors.New("internal server error")
)
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { Add(ctx context.Context, user *entity.USER) error GetAll(ctx context.Context) ([]entity.USER, error) GetOne(ctx context.Context, email string) (*entity.USER, error) Delete(ctx context.Context, email string) error }
Interface defines the contract for user repository operations.
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository implements the Interface for PostgreSQL operations.
func NewUserRepository ¶
func NewUserRepository(db *sql.DB) *UserRepository
NewOfficerRepository creates a new UserRepository instance. It takes a PostgreSQL database connection as a parameter.
func (*UserRepository) Delete ¶
func (o *UserRepository) Delete(ctx context.Context, email string) error
Delete removes a user from the PostgreSQL database based on the provided email.
Click to show internal directories.
Click to hide internal directories.