code: func CreateSessionFromConfig(config *ClientConfig) (*gocql.Session, error) {
  
  	gocqlClusterConfig := gocql.NewCluster(HostsAsString(config.Hosts))
  	gocqlClusterConfig.Port = config.Port
  	gocqlClusterConfig.ConnectTimeout = config.ConnectTimeout
  	gocqlClusterConfig.ReconnectInterval = config.ReconnectInterval
  	gocqlClusterConfig.Timeout = config.Timeout
  	gocqlClusterConfig.ProtoVersion = config.ProtoVersion
  	gocqlClusterConfig.SslOpts = config.SslOpts
  
  	session, err := gocqlClusterConfig.CreateSession()
  
  	if err != nil {
  		return nil, err
  	}
  
  	return session, nil
  }
docs: // CreateSessionFromConfig creates and initializes the cluster based on the supplied config
  // and returns a new session object that can be used to interact with the database.
  // The function propagates errors returned from gocql.CreateSession().