示例#1
0
文件: index.go 项目: npk/trailk
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
文件: history.go 项目: npk/trailk
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
}