Documentation
¶
Overview ¶
Package menu contains the repository implementation for the menu entity
Package menu contains the repository implementation for the menu entity ¶
Package menu contains the repository implementation for the menu entity
Index ¶
- type Menu
- type Repository
- func (r *Repository) Create(ctx context.Context, newMenu *domainMenu.Menu) (*domainMenu.Menu, error)
- func (r *Repository) Delete(ctx context.Context, id int64) (err error)
- func (r *Repository) GetAll(ctx context.Context, page int64, limit int64) (*repository.PaginationResultMenu, error)
- func (r *Repository) GetByID(ctx context.Context, id int64) (*domainMenu.Menu, error)
- func (r *Repository) GetByTopCount(ctx context.Context, count int) ([]domainMenu.Menu, 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 Menu ¶
type Menu struct { ID int64 `db:"id" example:"123"` Name string `db:"name" example:"Hyderabadi Dum Briyani"` Description string `db:"description" example:"Some Description"` Price int `db:"price" example:"20050"` 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"` Count int `db:"count" example:"3"` }
Menu is a struct that contains the menu model
type Repository ¶
Repository is a struct that contains the database implementation for menu entity
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, newMenu *domainMenu.Menu) (*domainMenu.Menu, error)
Create ... Insert New data
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, id int64) (err error)
Delete ... Delete menu
func (*Repository) GetAll ¶
func (r *Repository) GetAll(ctx context.Context, page int64, limit int64) (*repository.PaginationResultMenu, error)
GetAll Fetch all menu data
func (*Repository) GetByID ¶
func (r *Repository) GetByID(ctx context.Context, id int64) (*domainMenu.Menu, error)
GetByID ... Fetch only one menu by Id
func (*Repository) GetByTopCount ¶
func (r *Repository) GetByTopCount(ctx context.Context, count int) ([]domainMenu.Menu, error)
GetByTopCount ... Fetch only top menus by count
func (*Repository) GetTotalCount ¶
func (r *Repository) GetTotalCount(ctx context.Context) (int64, error)
GetTotalCount Fetch total menu count
Click to show internal directories.
Click to hide internal directories.