func WithTLSCfg(v *tls.Config) Option {
	return func(c *cfg) {
		c.tlsCfg = v
	}
}
WithTLSCfg returns option to specify
TLS configuration.

Ignored if WithGRPCConn is provided.
package client
import (
	"crypto/tls"
	"net/url"
	"time"
	"google.golang.org/grpc"
)
const (
	grpcScheme    = "grpc"
	grpcTLSScheme = "grpcs"
)
type Option func(*cfg)
type cfg struct {
	addr string
	dialTimeout time.Duration
	tlsCfg *tls.Config
	conn *grpc.ClientConn
}
const defaultDialTimeout = 5 * time.Second
func defaultCfg() *cfg {
	return &cfg{
		dialTimeout: defaultDialTimeout,
	}
}
func WithNetworkAddress(v string) Option {
	return func(c *cfg) {
		if v != "" {
			c.addr = v
		}
	}
}
func WithNetworkURIAddress(addr string, tlsCfg *tls.Config) []Option {
	uri, err := url.ParseRequestURI(addr)
	if err != nil {
		return []Option{WithNetworkAddress(addr)}
	}
	if uri.Opaque != "" {
		return []Option{WithNetworkAddress(addr)}
	}
	switch uri.Scheme {
	case grpcScheme:
		tlsCfg = nil
	case grpcTLSScheme:
		if tlsCfg == nil {
			tlsCfg = &tls.Config{}
		}
	default:
		return nil
	}
	return []Option{
		WithNetworkAddress(uri.Host),
		WithTLSCfg(tlsCfg),
	}
}
func WithDialTimeout(v time.Duration) Option {
	return func(c *cfg) {
		if v > 0 {
			c.dialTimeout = v
		}
	}
}