Documentation ¶
Index ¶
Constants ¶
View Source
const ( GETALL = "SELECT * FROM sellers" GETBYID = "SELECT * FROM sellers WHERE id=?" INSERT = "INSERT INTO sellers (cid, company_name, address, telephone, locality_id) VALUES (?,?,?,?,?)" UPDATE = "UPDATE sellers SET cid=?, company_name=?, address=?, telephone=?, locality_id=? WHERE id=?" DELETE = "DELETE FROM sellers WHERE id=?" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { GetOne(ctx context.Context, id int) (Seller, error) GetAll(ctx context.Context) ([]Seller, error) Create(ctx context.Context, cid int, companyName, address, telephone string, localityID int) (Seller, error) Update(ctx context.Context, cid int, companyName, address, telephone string, localityID int, seller Seller) (Seller, error) Delete(ctx context.Context, id int) error }
func NewMariaDBRepository ¶
func NewMariaDBRepository(db *sql.DB) Repository
type Service ¶
type Service interface { GetOne(ctx context.Context, id int) (Seller, error) GetAll(ctx context.Context) ([]Seller, error) Create(ctx context.Context, cid int, companyName, address, telephone string, localityID int) (Seller, error) Update(ctx context.Context, id, cid int, companyName, address, telephone string, localityID int) (Seller, error) Delete(ctx context.Context, id int) error }
func NewService ¶
func NewService(r Repository, lr l.Repository) Service
Click to show internal directories.
Click to hide internal directories.