// List returns all the existing products in the system.
List returns all the existing products in the system.
// List returns all the existing products in the system .
func (p *Product) List(ctx context.Context, log *log.Logger, w http.ResponseWriter, r *http.Request, params map[string]string) error {
	ctx, span := trace.StartSpan(ctx, "handlers.Product.List")
	defer span.End()
	dbConn := p.MasterDB.Copy()
	defer dbConn.Close()
	products, err := product.List(ctx, dbConn)
	if err = translate(err); err != nil {
		return errors.Wrap(err, "")
	}
	web.Respond(ctx, log, w, products, http.StatusOK)
	return nil
}
func ( p * Product ) List ( ctx context . Context , log * log . Logger , w http . ResponseWriter , r * http . Request , params map [ string ] string ) error { ctx , span := trace . StartSpan ( ctx , " " ) defer span . End ( ) dbConn := p . MasterDB . Copy ( ) defer dbConn . Close ( ) products , err := product . List ( ctx , dbConn ) if err = translate ( err ) ; err != nil { return errors . Wrap ( err , " " ) } web . Respond ( ctx , log , w , products , http . StatusOK ) return nil }
List returns all the existing products in the system.
List returns all the existing products in the system .