Documentation ¶
Index ¶
- type CompaniesRepo
- func (c *CompaniesRepo) Create(company models.Company) (models.Company, error)
- func (c *CompaniesRepo) Delete(id uint64) error
- func (c *CompaniesRepo) Get(id uint64) (models.Company, error)
- func (c *CompaniesRepo) GetAll(p requests.CompanyPayload) ([]models.Company, error)
- func (c *CompaniesRepo) Update(company models.Company) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompaniesRepo ¶
type CompaniesRepo struct {
// contains filtered or unexported fields
}
CompaniesRepo allows to store and retrieve companies from the database.
func NewCompaniesRepo ¶
func NewCompaniesRepo(db *gorm.DB) *CompaniesRepo
NewCompaniesRepo creates a new instance of the CompaniesRepo.
func (*CompaniesRepo) Delete ¶
func (c *CompaniesRepo) Delete(id uint64) error
Delete deletes a company from the database.
func (*CompaniesRepo) Get ¶
func (c *CompaniesRepo) Get(id uint64) (models.Company, error)
Get returns a single company from the database. If a company with the given id does not exist in the database this function returns a ErrCompanyNotFound error.
func (*CompaniesRepo) GetAll ¶
func (c *CompaniesRepo) GetAll(p requests.CompanyPayload) ([]models.Company, error)
GetAll returns all companies from the database.
Click to show internal directories.
Click to hide internal directories.