Documentation ¶
Overview ¶
Package diner contains the repository implementation for the diner entity
Package diner contains the repository implementation for the diner entity ¶
Package diner contains the repository implementation for the diner entity
Index ¶
- type Diner
- type Repository
- func (r *Repository) Create(ctx context.Context, newDiner *domainDiner.Diner) (*domainDiner.Diner, error)
- func (r *Repository) Delete(ctx context.Context, id int64) (err error)
- func (r *Repository) GetAll(ctx context.Context, page int64, limit int64) (*repository.PaginationResultDiner, error)
- func (r *Repository) GetByID(ctx context.Context, id int64) (*domainDiner.Diner, error)
- func (r *Repository) GetTotalCount(ctx context.Context) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diner ¶
type Diner struct { ID int64 `db:"id" example:"123"` TableNumber int `db:"table_no" example:"101"` Name string `db:"name" example:"Mr. Smith"` CreatedAt time.Time `db:"created_at" example:"2021-02-24 20:19:39"` UpdatedAt time.Time `db:"updated_at" example:"2021-02-24 20:19:39"` }
Diner is a struct that contains the diner model
type Repository ¶
Repository is a struct that contains the database implementation for diner entity
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, newDiner *domainDiner.Diner) (*domainDiner.Diner, error)
Create ... Insert New data
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, id int64) (err error)
Delete ... Delete diner
func (*Repository) GetAll ¶
func (r *Repository) GetAll(ctx context.Context, page int64, limit int64) (*repository.PaginationResultDiner, error)
GetAll Fetch all diner data
func (*Repository) GetByID ¶
func (r *Repository) GetByID(ctx context.Context, id int64) (*domainDiner.Diner, error)
GetByID ... Fetch only one diner by Id
func (*Repository) GetTotalCount ¶
func (r *Repository) GetTotalCount(ctx context.Context) (int64, error)
GetTotalCount Fetch total count of diners
Click to show internal directories.
Click to hide internal directories.