Пример #1
0
func (s *setupStruct) setupRethink() {
	cfg := s.Config
	re, err := rethink.NewInstance(gorethink.ConnectOpts{
		Address:  cfg.RethinkDB.Addr + ":" + cfg.RethinkDB.Port,
		Database: cfg.RethinkDB.DBName,
	})

	if err != nil {
		l.Fatalln("Could not connect to RethinkDB")
	}

	s.Rethink = re
}
Пример #2
0
func (s *setupStruct) setupRethink() {
	cfg := s.Config
	re, err := rethink.NewInstance(gorethink.ConnectOpts{
		Address:  cfg.RethinkDB.Addr + ":" + cfg.RethinkDB.Port,
		Database: cfg.RethinkDB.DBName,
	})

	if err != nil {
		l.Fatalln("Could not connect to RethinkDB")
	}

	s.Rethink = re

	script := dbscript.NewRethinkScript(s.Rethink, s.Config.RethinkDB.DBName)
	if err := script.Setup(); err != nil {
		l.Fatalln("Error generating data", err)
	}
}