-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconnector.go
58 lines (56 loc) · 1.36 KB
/
connector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package spanner
import (
"github.com/kubemq-hub/builder/connector/common"
)
func Connector() *common.Connector {
return common.NewConnector().
SetKind("gcp.spanner").
SetDescription("GCP Spanner Target").
SetName("Spanner").
SetProvider("GCP").
SetCategory("Store").
SetTags("db", "sql", "cloud", "managed").
AddProperty(
common.NewProperty().
SetKind("string").
SetName("db").
SetTitle("Database name").
SetDescription("Set GCP Spanner DB").
SetMust(true).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("multilines").
SetName("credentials").
SetTitle("Json Credentials").
SetDescription("Set GCP credentials").
SetMust(true).
SetDefault(""),
).
AddMetadata(
common.NewMetadata().
SetName("method").
SetKind("string").
SetDescription("Set Spanner execution method").
SetOptions([]string{"query", "read", "update_database_ddl", "insert", "update", "insert_or_update"}).
SetDefault("query").
SetMust(true),
).
AddMetadata(
common.NewMetadata().
SetName("query").
SetKind("string").
SetDescription("Set Spanner query request").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("table_name").
SetKind("string").
SetDescription("Set Spanner table_name").
SetDefault("").
SetMust(false),
)
}