Exemplo n.º 1
0
func main() {

	dbmap := dbihelper.GetDBI()

	// Start manager
	toElasticCh := make(chan dbstruct.Row, 1)
	rowsCh := make(chan []dbstruct.Row, 1)
	manager.Start(toElasticCh, rowsCh)

	// Start saving to elasticserach
	finishElasticSaveCh := save2elastic.Start(toElasticCh)

	// Start reading from DB
	iterator.ReadAll(dbmap, rowsCh, limitReadOneTime)

	// wait while elasticsearch are getting data
	<-finishElasticSaveCh
}
Exemplo n.º 2
0
func main() {
	dbmap := dbihelper.GetDBI()
	create_tables(dbmap)
	load_test_data(dbmap, countTestProducts)
}