Skip to content

Commit

Permalink
support set grpc client config by env (#321)
Browse files Browse the repository at this point in the history
Co-authored-by: sfwn <[email protected]>
  • Loading branch information
chengjoey and sfwn authored May 27, 2024
1 parent 128f3be commit 2e7f5ff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions providers/grpcclient/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ var (
)

type config struct {
Addr string `file:"addr" default:":7070" desc:"the server address in the format of host:port"`
Addr string `file:"addr" env:"GRPC_CLIENT_ADDR" default:":7070" desc:"the server address in the format of host:port"`
TLS struct {
ServerNameOverride string `file:"cert_file" desc:"the server name used to verify the hostname returned by the TLS handshake"`
CAFile string `file:"ca_file" desc:"the file containing the CA root cert file"`
InsecureSkipVerify bool `file:"insecure_skip_verify" desc:"skip verify"`
ServerNameOverride string `file:"cert_file" env:"GRPC_CLIENT_CERT_FILE" desc:"the server name used to verify the hostname returned by the TLS handshake"`
CAFile string `file:"ca_file" env:"GRPC_CLIENT_CA_FILE" desc:"the file containing the CA root cert file"`
InsecureSkipVerify bool `file:"insecure_skip_verify" env:"GRPC_CLIENT_INSECURE_SKIP_VERIFY" desc:"skip verify"`
} `file:"tls"`
Singleton bool `file:"singleton" default:"true" desc:"one client instance"`
Block bool `file:"block" default:"true" desc:"block until the connection is up"`
TraceEnable bool `file:"trace_enable" default:"true"`
Singleton bool `file:"singleton" env:"GRPC_CLIENT_SINGLETON" default:"true" desc:"one client instance"`
Block bool `file:"block" env:"GRPC_CLIENT_BLOCK" default:"true" desc:"block until the connection is up"`
TraceEnable bool `file:"trace_enable" env:"GRPC_CLIENT_TRACE_ENABLE" default:"true"`
}

type provider struct {
Expand Down

0 comments on commit 2e7f5ff

Please sign in to comment.