-
Notifications
You must be signed in to change notification settings - Fork 6
/
connector.go
97 lines (95 loc) · 2.3 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package storage
import (
"github.com/kubemq-hub/builder/connector/common"
)
func Connector() *common.Connector {
return common.NewConnector().
SetKind("gcp.storage").
SetDescription("GCP Storage Target").
SetName("Storage").
SetProvider("GCP").
SetCategory("Storage").
SetTags("db", "filesystem", "object", "cloud", "managed").
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 GCP Storage method").
SetOptions([]string{"upload", "create_bucket", "download", "delete", "rename", "copy", "move", "list"}).
SetDefault("create_bucket").
SetMust(true),
).
AddMetadata(
common.NewMetadata().
SetName("object").
SetKind("string").
SetDescription("Set object name to save the file under").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("rename_object").
SetKind("string").
SetDescription("Set GCP name to change the file name").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("bucket").
SetKind("string").
SetDescription("Set Storage bucket name").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("dst_bucket").
SetKind("string").
SetDescription("Set the bucket name of the destination").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("path").
SetKind("string").
SetDescription("Set path to the file for upload").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("project_id").
SetKind("string").
SetDescription("Set GCP storage project id ").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("storage_class").
SetKind("string").
SetDescription("Set GCP storage class").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("location").
SetKind("string").
SetDescription("Set GCP storage location").
SetDefault("").
SetMust(false),
)
}