func ListProductEvents(apiURL string) ([]*ProductEvent, error) {

	resp, err := http.Get(apiURL)
	if err != nil {
		return nil, fmt.Errorf("Could not get events from local http server:%v", err)
	}
	defer resp.Body.Close()

	events := []*ProductEvent{}
	err = json.NewDecoder(resp.Body).Decode(&events)
	if err != nil {
		return nil, fmt.Errorf("failed to decode event: %v", err)
	}

	return events, nil
}
// ListProductEvents will give all available events from the specified events cache.
ListProductEvents will give all available events from the specified events cache.
// ListProductEvents will give all available events from the specified events cache .
func ListProductEvents(apiURL string) ([]*ProductEvent, error) {
	resp, err := http.Get(apiURL)
	if err != nil {
		return nil, fmt.Errorf("Could not get events from local http server:%v", err)
	}
	defer resp.Body.Close()
	events := []*ProductEvent{}
	err = json.NewDecoder(resp.Body).Decode(&events)
	if err != nil {
		return nil, fmt.Errorf("failed to decode event: %v", err)
	}
	return events, nil
}
func ListProductEvents ( apiURL string ) ( [ ] * ProductEvent , error ) { resp , err := http . Get ( apiURL ) if err != nil { return nil , fmt . Errorf ( " " , err ) } defer resp . Body . Close ( ) events := [ ] * ProductEvent { } err = json . NewDecoder ( resp . Body ) . Decode ( & events ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return events , nil }
ListProductEvents will give all available events from the specified events cache.
ListProductEvents will give all available events from the specified events cache .