@@ -19,16 +19,17 @@ import (
19
19
)
20
20
21
21
const (
22
- defaultRequestTimeout = 5 * time .Second
23
- defaultReadTimeout = 10 * time .Second
24
- descriptorTimeout = time .Minute
25
- maxRequestSize = 10024
26
- httpServerAddr = "0.0.0.0:8080"
27
- reflectionServiceName = "grpc.reflection.v1.ServerReflection/ServerReflectionInfo"
28
- excludedDescriptors = "grpc.health.v1.Health,grpc.reflection.v1.ServerReflection"
29
- grpcServerAddr = "0.0.0.0:50051"
30
- tls = false
31
- tlsSkipverify = false
22
+ defaultRequestTimeout = 5 * time .Second
23
+ defaultReadTimeout = 10 * time .Second
24
+ descriptorTimeout = time .Minute
25
+ maxRequestSize = 10024
26
+ httpServerAddr = "0.0.0.0:8080"
27
+ defaultDescriptorsFetchingType = "remote"
28
+ reflectionServiceName = "grpc.reflection.v1.ServerReflection/ServerReflectionInfo"
29
+ excludedDescriptors = "grpc.health.v1.Health,grpc.reflection.v1.ServerReflection"
30
+ grpcServerAddr = "0.0.0.0:50051"
31
+ tls = false
32
+ tlsSkipverify = false
32
33
)
33
34
34
35
var (
@@ -47,6 +48,7 @@ func main() {
47
48
pflag .Duration ("transport.http.server.readTimeout" , defaultReadTimeout , "read timeout" )
48
49
pflag .Duration ("transport.http.server.readHeaderTimeout" , defaultRequestTimeout , "read header timeout" )
49
50
51
+ pflag .String ("descriptors.kind" , defaultDescriptorsFetchingType , "type of descriptors fetching" )
50
52
pflag .Duration ("descriptors.remote.timeout" , descriptorTimeout , "request timeout for remote descriptors" )
51
53
pflag .String ("descriptors.remote.reflectionServiceName" , reflectionServiceName , "reflection service name" )
52
54
pflag .StringArray ("descriptors.remote.exclude" , strings .Split (excludedDescriptors , "," ), "remote descriptors to exclude" )
@@ -79,7 +81,7 @@ func main() {
79
81
os .Exit (1 )
80
82
}
81
83
82
- if configFile != nil {
84
+ if configFile != nil && * configFile != "" {
83
85
err := loadConfigFromFile (* configFile , conf )
84
86
if err != nil {
85
87
logging .Error (jErrors .Details (jErrors .Trace (err )))
0 commit comments