code: func ConfigToClientConfig(ymlConfig *Config) (*ClientConfig, error) {
  
  	timeout := defaultOpTimeout
  	if ymlConfig.OpTimeout > 0 {
  		timeout = ymlConfig.OpTimeout
  	}
  
  	connectTimeout := defaultDialTimeout
  	if ymlConfig.DialTimeout > 0 {
  		connectTimeout = ymlConfig.DialTimeout
  	}
  
  	reconnectInterval := defaultRedialInterval
  	if ymlConfig.RedialInterval > 0 {
  		reconnectInterval = ymlConfig.RedialInterval
  	}
  
  	protoVersion := defaultProtocolVersion
  	if ymlConfig.ProtocolVersion > 0 {
  		protoVersion = ymlConfig.ProtocolVersion
  	}
  
  	endpoints, port, err := getEndpointsAndPort(ymlConfig.Endpoints)
  	if err != nil {
  		return nil, err
  	}
  
  	var sslOpts *gocql.SslOptions
  	if ymlConfig.TLS.Enabled {
  		sslOpts = &gocql.SslOptions{
  			CaPath:                 ymlConfig.TLS.CAfile,
  			CertPath:               ymlConfig.TLS.Certfile,
  			KeyPath:                ymlConfig.TLS.Keyfile,
  			EnableHostVerification: ymlConfig.TLS.EnableHostVerification,
  		}
  	}
  
  	clientConfig := &gocql.ClusterConfig{
  		Hosts:             endpoints,
  		Port:              port,
  		Timeout:           timeout * time.Millisecond,
  		ConnectTimeout:    connectTimeout * time.Millisecond,
  		ReconnectInterval: reconnectInterval * time.Second,
  		ProtoVersion:      protoVersion,
  		SslOpts:           sslOpts,
  	}
  
  	cfg := &ClientConfig{ClusterConfig: clientConfig}
  
  	return cfg, nil
  }
docs: // ConfigToClientConfig transforms the yaml configuration into ClientConfig.
  // If the configuration of endpoints is invalid, error ErrInvalidEndpointConfig
  // is returned.