This repository has been archived by the owner on Jan 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstorageocdata.go
111 lines (99 loc) · 3.31 KB
/
storageocdata.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
// StorageOCDataWithConfig applies cfg to the root flagset
func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
flags := []cli.Flag{
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9165",
Usage: "Address to bind debug server",
EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageOCData.DebugAddr,
},
// Services
// Storage oc data
&cli.StringFlag{
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVars: []string{"REVA_STORAGE_OC_DATA_NETWORK"},
Destination: &cfg.Reva.StorageOCData.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "http",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVars: []string{"REVA_STORAGE_OC_DATA_PROTOCOL"},
Destination: &cfg.Reva.StorageOCData.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9164",
Usage: "Address to bind reva service",
EnvVars: []string{"REVA_STORAGE_OC_DATA_ADDR"},
Destination: &cfg.Reva.StorageOCData.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9164",
Usage: "URL to use for the reva service",
EnvVars: []string{"REVA_STORAGE_OC_DATA_URL"},
Destination: &cfg.Reva.StorageOCData.URL,
},
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("dataprovider"),
Usage: "--service dataprovider [--service otherservice]",
EnvVars: []string{"REVA_STORAGE_OC_DATA_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: "owncloud",
Usage: "storage driver for oc data mount: eg. local, eos, owncloud, ocis or s3",
EnvVars: []string{"REVA_STORAGE_OC_DATA_DRIVER"},
Destination: &cfg.Reva.StorageOCData.Driver,
},
&cli.StringFlag{
Name: "prefix",
Value: "data",
Usage: "prefix for the http endpoint, without leading slash",
EnvVars: []string{"REVA_STORAGE_OC_DATA_PREFIX"},
Destination: &cfg.Reva.StorageOCData.Prefix,
},
&cli.StringFlag{
Name: "temp-folder",
Value: "/var/tmp/",
Usage: "temp folder",
EnvVars: []string{"REVA_STORAGE_OC_DATA_TEMP_FOLDER"},
Destination: &cfg.Reva.StorageOCData.TempFolder,
},
// Gateway
&cli.StringFlag{
Name: "gateway-url",
Value: "localhost:9142",
Usage: "URL to use for the reva gateway service",
EnvVars: []string{"REVA_GATEWAY_URL"},
Destination: &cfg.Reva.Gateway.URL,
},
// User provider
&cli.StringFlag{
Name: "users-url",
Value: "localhost:9144",
Usage: "URL to use for the reva service",
EnvVars: []string{"REVA_USERS_URL"},
Destination: &cfg.Reva.Users.URL,
},
}
flags = append(flags, TracingWithConfig(cfg)...)
flags = append(flags, DebugWithConfig(cfg)...)
flags = append(flags, SecretWithConfig(cfg)...)
flags = append(flags, DriverEOSWithConfig(cfg)...)
flags = append(flags, DriverLocalWithConfig(cfg)...)
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
flags = append(flags, DriverOCISWithConfig(cfg)...)
return flags
}