Documentation ¶
Index ¶
- func InitData(db *gorm.DB) (err error)
- type EmployeeDBModel
- type Repository
- type SQLRepository
- func (r SQLRepository) AddEmployee(ctx context.Context, newEmployee *EmployeeDBModel) (err error)
- func (r SQLRepository) DeleteEmployee(ctx context.Context, employeeID int64) (err error)
- func (r SQLRepository) GetAllEmployees(ctx context.Context) (people []EmployeeDBModel, err error)
- func (r SQLRepository) GetEmployee(ctx context.Context, employeeID int64) (*EmployeeDBModel, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmployeeDBModel ¶
type Repository ¶
type Repository interface { GetAllEmployees(ctx context.Context) ([]EmployeeDBModel, error) AddEmployee(ctx context.Context, newEmployee *EmployeeDBModel) error GetEmployee(ctx context.Context, employeeID int64) (*EmployeeDBModel, error) DeleteEmployee(ctx context.Context, employeeID int64) error }
func NewSQLRepository ¶
func NewSQLRepository(db *gorm.DB) Repository
type SQLRepository ¶
type SQLRepository struct {
// contains filtered or unexported fields
}
func (SQLRepository) AddEmployee ¶
func (r SQLRepository) AddEmployee(ctx context.Context, newEmployee *EmployeeDBModel) (err error)
func (SQLRepository) DeleteEmployee ¶
func (r SQLRepository) DeleteEmployee(ctx context.Context, employeeID int64) (err error)
func (SQLRepository) GetAllEmployees ¶
func (r SQLRepository) GetAllEmployees(ctx context.Context) (people []EmployeeDBModel, err error)
func (SQLRepository) GetEmployee ¶
func (r SQLRepository) GetEmployee(ctx context.Context, employeeID int64) (*EmployeeDBModel, error)
Click to show internal directories.
Click to hide internal directories.