Exemplo n.º 1
0
Arquivo: index.go Projeto: 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)
}
Exemplo n.º 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
}