Пример #1
0
func getSummaryReports(
	sStringID string,
	stype string,
	startTime time.Time,
	summaries *summary.Summaries) []*summary.Report {
	var reports []*summary.Report
	sm := summaries.Select(stype)
	data, err := sm.Get(sStringID)

	if err != nil {
		return reports
	}

	return data.Report().Fetch(startTime)
}
Пример #2
0
func getSummaryReport(
	sStringID string,
	stype string,
	startTime time.Time,
	summaries *summary.Summaries) []*report {
	var reports []*report
	sm := summaries.Select(stype)
	data, err := sm.Get(sStringID)

	if err != nil {
		return []*report{}
	}

	for _, r := range data.Report().Fetch(startTime) {
		nR := &report{}
		nR.Report = r
		nR.Timestamp = r.End.Unix()

		reports = append(reports, nR)
	}

	return reports
}