yjp 1 年之前
父节点
当前提交
796a1b22d0

+ 1 - 1
examples/examples/binding_ds/main.go

@@ -30,7 +30,7 @@ func main() {
 					BaseUrl:     "http://localhost:10000",
 					GrpcAddress: "localhost:10001",
 					Namespace:   "baize",
-					DataSource:  "baize-binding",
+					DataSource:  "baize",
 					TimeoutSec:  30,
 				},
 			},

+ 8 - 1
examples/examples/project/deployment/config/config.yaml

@@ -10,4 +10,11 @@ infrastructure:
       port: 30432
       database: test
       max_connections: 20
-      max_idle_connections: 5
+      max_idle_connections: 5
+    data_service:
+      token: "8qe+uPgpQ2JWxu3lSyOx5NjX+INp5WsnoD1ZWb7PBm4="
+      base_url: http://localhost:10000
+      grpc_address: localhost:10001
+      namespace: "baize"
+      data_source: "baize"
+      timeout_sec: 30

+ 3 - 3
examples/examples/project/deployment/resources/resources.yaml

@@ -8,7 +8,7 @@ kind: DataSource
 spec:
   type: database
   namespace: baize
-  name: baize-binding
+  name: baize
   spec:
     type: postgres
     user_name: test
@@ -24,7 +24,7 @@ spec:
 kind: DataContainer
 spec:
   namespace: baize
-  data_source: baize-binding
+  data_source: baize
   name: test.classes
   spec:
     table_name: test.classes
@@ -57,7 +57,7 @@ spec:
 kind: DataContainer
 spec:
   namespace: baize
-  data_source: baize-binding
+  data_source: baize
   name: test.configurations
   spec:
     table_name: test.configurations

+ 3 - 3
examples/resources.yaml

@@ -8,7 +8,7 @@ kind: DataSource
 spec:
   type: database
   namespace: baize
-  name: baize-binding
+  name: baize
   spec:
     type: postgres
     user_name: test
@@ -24,7 +24,7 @@ spec:
 kind: DataContainer
 spec:
   namespace: baize
-  data_source: baize-binding
+  data_source: baize
   name: test.classes
   spec:
     table_name: test.classes
@@ -57,7 +57,7 @@ spec:
 kind: DataContainer
 spec:
   namespace: baize
-  data_source: baize-binding
+  data_source: baize
   name: test.configurations
   spec:
     table_name: test.configurations

+ 6 - 6
infrastructure/database/data_service/data_service.go

@@ -12,12 +12,12 @@ import (
 )
 
 type Config struct {
-	Token       string
-	BaseUrl     string
-	GrpcAddress string
-	Namespace   string
-	DataSource  string
-	TimeoutSec  time.Duration
+	Token       string        `json:"token" yaml:"token"`
+	BaseUrl     string        `json:"base_url" yaml:"base_url"`
+	GrpcAddress string        `json:"grpc_address" yaml:"grpc_address"`
+	Namespace   string        `json:"namespace" yaml:"namespace"`
+	DataSource  string        `json:"data_source" yaml:"data_source"`
+	TimeoutSec  time.Duration `json:"timeout_sec" yaml:"timeout_sec"`
 }
 
 type DataService struct {