예제 #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
파일: setup.go 프로젝트: ngthorg/grox
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)
	}
}