Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Target is the address of the gRPC server, as "localhost:50051" Target string `cfg:"target"` // Authority sets the grpc.WithAuthority. Authority string `cfg:"authority"` // TLS is the TLS configuration for the connection. TLS TLSConfig `cfg:"tls"` // Block will block the Dial method until connection is established. Block bool `cfg:"block" default:"true"` DialTimeout time.Duration `cfg:"dial_timeout" default:"5s"` }
func (Config) Dial ¶
func (c Config) Dial(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
Dial dials the target gRPC server.
type TLSConfig ¶
type TLSConfig struct { Enabled bool `cfg:"enabled"` InsecureSkipVerify bool `cfg:"insecure_skip_verify"` // CertFile is the path to the client's TLS certificate. // Should be use with KeyFile. CertFile string `cfg:"cert_file"` // KeyFile is the path to the client's TLS key. // Should be use with CertFile. KeyFile string `cfg:"key_file"` // CAFile is the path to the CA certificate. // If empty, the server's root CA set will be used. CAFile string `cfg:"ca_file"` // ServerName is the server name used to verify the hostname on the returned certificates from the server. ServerName string `cfg:"server_name"` }
Click to show internal directories.
Click to hide internal directories.