Documentation
¶
Index ¶
- type ProductManager
- func (m *ProductManager) AddProduct(ctx context.Context, params product_management.AddProductParams) middleware.Responder
- func (m *ProductManager) GetProduct(ctx context.Context, params product_management.GetProductParams) middleware.Responder
- func (m *ProductManager) ListProducts(ctx context.Context, params product_management.ListProductsParams) middleware.Responder
- func (m *ProductManager) UpdateProduct(ctx context.Context, params product_management.UpdateProductParams) middleware.Responder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductManager ¶
type ProductManager struct {
BasePath string
// contains filtered or unexported fields
}
ProductManager is the struct defined to group and contain all the methods that interact with the product endpoint. Parameters: - db: a DbParameter reference to be able to use the DBManager methods. - monit: a StatusManager reference to be able to use the status subsystem methods. - BasePath: a string with the base path of the system.
func New ¶
func New(db *dbManager.DbParameter, monit *statusManager.StatusManager, bp string) *ProductManager
New is the function to create the struct ProductManager that grant access to the methods to interact with the Product endpoint. Parameters: - db: a reference to the DbParameter to be able to interact with the db methods. - monit: a reference to the StatusManager to be able to interact with the status subsystem. - bp: a string containing the base path of the service. Returns: - ProductManager: struct to interact with product endpoint functionalities.
func (*ProductManager) AddProduct ¶
func (m *ProductManager) AddProduct(ctx context.Context, params product_management.AddProductParams) middleware.Responder
AddProduct (Swagger func) is the function behind the (POST) API Endpoint /product Its function is to add the provided product into the db.
func (*ProductManager) GetProduct ¶
func (m *ProductManager) GetProduct(ctx context.Context, params product_management.GetProductParams) middleware.Responder
GetProduct (Swagger func) is the function behind the (GET) API Endpoint /product/{id} Its function is to retrieve the information that the system has about the product whose ID has been provided.
func (*ProductManager) ListProducts ¶
func (m *ProductManager) ListProducts(ctx context.Context, params product_management.ListProductsParams) middleware.Responder
ListProducts (Swagger func) is the function behind the (GET) API Endpoint /product Its function is to provide a list containing all the products in the system.
func (*ProductManager) UpdateProduct ¶
func (m *ProductManager) UpdateProduct(ctx context.Context, params product_management.UpdateProductParams) middleware.Responder
UpdateProduct (Swagger func) is the function behind the (PUT) API Endpoint /product/{id} Its function is to update the product whose ID is provided with the new data.