Documentation
¶
Index ¶
- func NewOrderLogic(Db SqliteDatabase) models.ManupilatorOrder
- func NewProductLogic(Db SqliteDatabase) models.ManipulatorProduct
- func NewShopLogic(Db SqliteDatabase) models.ManipulatorShop
- func NewUserLogic(Db SqliteDatabase) models.ManipulatorUser
- type Database
- func (db *Database) Add(ctx context.Context, Input interface{}) *gorm.DB
- func (db *Database) AppendTo(field string, Model interface{}, Paylod interface{}, ctx context.Context) error
- func (db *Database) CreateTable(Model interface{}) error
- func (db *Database) DeleteRecordById(ctx context.Context, Model interface{}, Id uint) *gorm.DB
- func (db *Database) FindAll(limit int, RespPayload interface{}) (interface{}, error)
- func (db *Database) FindAllByCol(limit int, RespPayload interface{}, Col string, Input any, ctx context.Context) (interface{}, error)
- func (db *Database) FindOneByCol(ctx context.Context, VarToAssign interface{}, Col string, Input string) *gorm.DB
- func (db *Database) FindOneById(ctx context.Context, VarToAssign interface{}, Id uint) *gorm.DB
- func (db *Database) Init(location string) error
- func (db *Database) UpdateRow(ctx context.Context, Model interface{}, Col string, NewVal interface{}) *gorm.DB
- type OrderLogic
- type ProductLogic
- func (pl *ProductLogic) AddProducts(ctx context.Context, products []models.Product, shop *models.Shop) error
- func (pl *ProductLogic) GetProductById(ctx context.Context, Id uint) (models.Product, error)
- func (pl *ProductLogic) GetProducts(ctx context.Context, shop models.Shop, limit int) ([]models.Product, error)
- type ShopLogic
- func (sl *ShopLogic) CreateShop(ctx context.Context, shop models.Shop, user *models.User) error
- func (sl *ShopLogic) DeleteShop(ctx context.Context, Shop *models.Shop) error
- func (sl *ShopLogic) FetchAll(ctx context.Context, limit int) ([]models.Shop, error)
- func (sl *ShopLogic) FetchAllByFilter(ctx context.Context, limit int, filter string, filterVal string) ([]models.Shop, error)
- func (sl *ShopLogic) GetShopByID(ctx context.Context, ID uint) (models.Shop, error)
- func (sl *ShopLogic) GetShopByName(ctx context.Context, Name string) (models.Shop, error)
- func (sl *ShopLogic) UpdateShop(ctx context.Context, Shop *models.Shop, field string, value interface{}) error
- type SqliteDatabase
- type UserLogic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOrderLogic ¶
func NewOrderLogic(Db SqliteDatabase) models.ManupilatorOrder
func NewProductLogic ¶
func NewProductLogic(Db SqliteDatabase) models.ManipulatorProduct
func NewShopLogic ¶
func NewShopLogic(Db SqliteDatabase) models.ManipulatorShop
func NewUserLogic ¶
func NewUserLogic(Db SqliteDatabase) models.ManipulatorUser
Types ¶
type Database ¶
func (*Database) CreateTable ¶
func (*Database) DeleteRecordById ¶
func (*Database) FindAllByCol ¶
func (*Database) FindOneByCol ¶
func (*Database) FindOneById ¶
type OrderLogic ¶
type OrderLogic struct {
// contains filtered or unexported fields
}
func (OrderLogic) GetOrderById ¶
type ProductLogic ¶
type ProductLogic struct {
// contains filtered or unexported fields
}
func (*ProductLogic) AddProducts ¶
func (*ProductLogic) GetProductById ¶
type ShopLogic ¶
type ShopLogic struct {
// contains filtered or unexported fields
}
func (*ShopLogic) CreateShop ¶
func (*ShopLogic) DeleteShop ¶
func (*ShopLogic) FetchAllByFilter ¶
func (*ShopLogic) GetShopByID ¶
func (*ShopLogic) GetShopByName ¶
type SqliteDatabase ¶
type SqliteDatabase interface {
Init(location string) error
CreateTable(Model interface{}) error
Add(ctx context.Context, Input interface{}) *gorm.DB
FindOneById(ctx context.Context, VarToAssign interface{}, id uint) *gorm.DB
FindOneByCol(ctx context.Context, VarToAssign interface{}, Col string, Input string) *gorm.DB
AppendTo(field string, Model interface{}, Paylod interface{}, ctx context.Context) error
FindAll(limit int, RespPayload interface{}) (interface{}, error)
FindAllByCol(limit int, RespPayload interface{}, Col string, Input any, ctx context.Context) (interface{}, error)
UpdateRow(ctx context.Context, Model interface{}, Col string, NewVal interface{}) *gorm.DB
DeleteRecordById(ctx context.Context, Model interface{}, Id uint) *gorm.DB
}
type UserLogic ¶
type UserLogic struct {
// contains filtered or unexported fields
}
func (*UserLogic) CreateUser ¶
func (UserLogic) GetByEmail ¶
Click to show internal directories.
Click to hide internal directories.