示例#1
0
func NewTestRethinkAPIServer() (server.APIServer, error) {
	address, err := getTestRethinkAddress()
	if err != nil {
		return nil, err
	}
	databaseName := uuid.NewWithoutDashes()
	if err := server.InitDBs(address, databaseName); err != nil {
		return nil, err
	}
	return server.NewRethinkAPIServer(address, databaseName)
}
示例#2
0
func getRethinkAPIServer(address string, databaseName string) (persist.APIServer, error) {
	var err error
	if address == "" {
		address, err = getRethinkAddress()
		if err != nil {
			return nil, err
		}
	}
	if err := persistserver.InitDBs(address, databaseName); err != nil {
		return nil, err
	}
	return persistserver.NewRethinkAPIServer(address, databaseName)
}
示例#3
0
文件: main.go 项目: tv42/pachyderm
func getRethinkAPIServer(env *appEnv) (persist.APIServer, error) {
	if err := persist_server.InitDBs(fmt.Sprintf("%s:28015", env.DatabaseAddress), env.DatabaseName); err != nil {
		protolion.Errorf("InitDBs returned error: %s", err.Error())
	}
	return persist_server.NewRethinkAPIServer(fmt.Sprintf("%s:28015", env.DatabaseAddress), env.DatabaseName)
}
示例#4
0
文件: main.go 项目: sammath/pachyderm
func getRethinkAPIServer(env *appEnv) (persist.APIServer, error) {
	if err := persistserver.InitDBs(getRethinkAddress(env), env.DatabaseName); err != nil {
		return nil, err
	}
	return persistserver.NewRethinkAPIServer(getRethinkAddress(env), env.DatabaseName)
}