Ejemplo n.º 1
0
func store(db statstore.Storer, ts time.Time, m map[string]interface{}) error {
	_, _, err := db.Insert(statstore.NewItem(m, ts))
	if err != nil {
		log.Printf("Error inserting data:  %v", err)
	}
	return err
}
Ejemplo n.º 2
0
func storer(w statstore.Storer, ch <-chan statstore.StoredItem) {
	defer wg.Done()

	for e := range ch {
		w.Insert(e)
	}
}