repositories

package
v0.0.0-...-d0b209f Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPatient

func AddPatient(cfg *config.Config, patient *models.Patient) error

Types

type DoctorRepository

type DoctorRepository interface {
	GetAllDoctors() ([]*models.Doctor, error)
	GetDoctorByID(id int) (*models.Doctor, error)
	AddDoctor(doctor *models.Doctor) error
	UpdateDoctor(doctor *models.Doctor) error
	DeleteDoctor(id int) error
}

DoctorRepository defines the interface for doctor-related data operations

func NewDoctorRepository

func NewDoctorRepository(db *sql.DB) DoctorRepository

NewDoctorRepository initializes a new doctor repository

type PatientRepository

type PatientRepository interface {
	AddPatient(patient *models.Patient) error
	GetPatientByID(id int) (*models.Patient, error)
	GetAllPatients() ([]*models.Patient, error)
	UpdatePatient(patient *models.Patient) error
	DeletePatient(id int) error
}

PatientRepository is the interface for Patient repository

func NewPatientRepository

func NewPatientRepository(db *sql.DB) PatientRepository

NewPatientRepository initializes a new patient repository

type UserRepository

type UserRepository interface {
	// GetUser returns a user by the given ID
	GetUserByID(id int) (*models.User, error)
	// AddUser adds a new user
	AddUser(user *models.User) error
	// DeleteUser deletes a user by the given ID
	DeleteUser(id int) error
	// UpdateUser updates a user
	UpdateUser(user *models.User) error
}

UserRepository is the interface for User repository

Jump to

Keyboard shortcuts

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