code: func DialWithConfig(ctx context.Context, cfg *config.Config) (*Client, error) {
  	options, err := configToOptions(cfg)
  	if err != nil {
  		return nil, err
  	}
  	return DialContext(ctx, options...)
  }
docs: // DialWithConfig will use the configuration settings parsed from config package
  // to connect to Elasticsearch.
  //
  // The context is honoured in terms of e.g. cancellation.