You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/11/25 03:14:39 UTC

[GitHub] [servicecomb-service-center] little-cui commented on a change in pull request #760: [SCB-2094] implement mongo init client

little-cui commented on a change in pull request #760:
URL: https://github.com/apache/servicecomb-service-center/pull/760#discussion_r530080561



##########
File path: datasource/mongo/config.go
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package mongo
+
+import (
+	"github.com/apache/servicecomb-service-center/server/config"
+	"github.com/go-chassis/go-chassis/v2/storage"
+	"sync"
+)
+
+var (
+	defaultConfig storage.DB
+	configOnce    sync.Once
+)
+
+func Configuration() storage.DB {

Review comment:
       不要使用这种机制,通过options来,否则后面就有两套配置了




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org