Ejemplo n.º 1
0
// Import gets data, transform it and send it to pillar
func Import() {

	// if there is a flag to start recording a report of failed records, then initialize it
	if options.ReportOnFailedRecords {
		report.Init(uuid, options.Reportdbfile)
	}

	//import only failed reportOnFailedRecords
	if options.Importonlyfailed {
		importOnlyFailedRecords() //dbsource, options)
		return
	}

	// import only the collections from the options
	if options.Types != "" {
		for _, t := range strings.Split(options.Types, ",") {
			importType(strings.Trim(t, " "))
		}
		return
	}

	// this is the func we are going to be running in daemon mode
	importAll()

}
Ejemplo n.º 2
0
func addReadReport(cmd *cobra.Command, args []string) {

	report.Init("reading", dbnameFlag)
	report.Print()

}