예제 #1
0
파일: rpc.go 프로젝트: haoqoo/vitess
// ServeRPC will deal with bson rpc serving
func ServeRPC() {
	// rpc.HandleHTTP registers the default GOB handler at /_goRPC_
	// and the debug RPC service at /debug/rpc (it displays a list
	// of registered services and their methods).
	if serviceMap["gob-vt"] {
		log.Infof("Registering GOB handler and /debug/rpc URL for vt port")
		rpc.HandleHTTP()
	}
	if serviceMap["gob-auth-vt"] {
		log.Infof("Registering GOB handler and /debug/rpcs URL for SASL vt port")
		rpcwrap.AuthenticatedServer.HandleHTTP(rpc.DefaultRPCPath, rpc.DefaultDebugPath+"s")
	}

	// if we have an authentication config, we register the authenticated
	// bsonrpc services.
	if *authConfig != "" {
		if err := auth.LoadCredentials(*authConfig); err != nil {
			log.Fatalf("could not load authentication credentials, not starting rpc servers: %v", err)
		}
		bsonrpc.ServeAuthRPC()
	}

	// and register the regular bsonrpc too.
	bsonrpc.ServeRPC()
}
예제 #2
0
func ServeRPC() {
	rpc.HandleHTTP()
	if *authConfig != "" {
		if err := auth.LoadCredentials(*authConfig); err != nil {
			log.Fatalf("could not load authentication credentials, not starting rpc servers: %v", err)
		}
		bsonrpc.ServeAuthRPC()
		jsonrpc.ServeAuthRPC()
	}

	jsonrpc.ServeHTTP()
	jsonrpc.ServeRPC()
	bsonrpc.ServeHTTP()
	bsonrpc.ServeRPC()
}
예제 #3
0
파일: rpc.go 프로젝트: chinna1986/vitess
func ServeRPC() {
	// rpc.HandleHTTP registers the default GOB handler at /_goRPC_
	// and the debug RPC service at /debug/rpc (it displays a list
	// of registered services and their methods).
	// So disabling this, but leaving a trace here so it's easy
	// to re-add for a quick test on which service is running.
	//
	// rpc.HandleHTTP()

	// if we have an authentication config, we register the authenticated
	// bsonrpc services.
	if *authConfig != "" {
		if err := auth.LoadCredentials(*authConfig); err != nil {
			log.Fatalf("could not load authentication credentials, not starting rpc servers: %v", err)
		}
		bsonrpc.ServeAuthRPC()
	}

	// and register the regular bsonrpc too.
	bsonrpc.ServeRPC()
}
예제 #4
0
파일: vtocc.go 프로젝트: Eric-Chen/vitess
func serveAuthRPC() {
	bsonrpc.ServeAuthRPC()
	jsonrpc.ServeAuthRPC()
}