func MakeHub(config HubConfig) (Hub, error) {
	if config == nil {
		return NewHub(), nil
	}

	driverName := getDriverName(config)
	if len(driverName) == 0 {
		return nil, fmt.Errorf("driver name is not specified")
	}
	d, ok := drivers[driverName]
	if ok {
		h, err := d.Create(config)
		if err != nil {
			log.Errorf("unable to connect to %s pubsub server: %+v", driverName, err)
			return nil, err
		}
		log.Info("connected to %s pubsub", driverName)
		return h, nil
	}

	return nil, fmt.Errorf("unknown driver: %s", driverName)
}
func MakeHub(config HubConfig) (Hub, error) {
	if config == nil {
		return NewHub(), nil
	}

	driverName := getDriverName(config)
	if len(driverName) == 0 {
		return nil, fmt.Errorf("driver name is not specified")
	}
	d, ok := drivers[driverName]
	if ok {
		h, err := d.Create(config)
		if err != nil {
			log.Errorf("unable to connect to %s pubsub server: %+v", driverName, err)
			return nil, err
		}
		log.Info("connected to %s pubsub", driverName)
		return h, nil
	}

	return nil, fmt.Errorf("unknown driver: %s", driverName)
}
func MakeHub ( config HubConfig ) ( Hub , error ) { if config == nil { return NewHub ( ) , nil } driverName := getDriverName ( config ) if len ( driverName ) == 0 { return nil , fmt . Errorf ( " " ) } d , ok := drivers [ driverName ] if ok { h , err := d . Create ( config ) if err != nil { log . Errorf ( " " , driverName , err ) return nil , err } log . Info ( " " , driverName ) return h , nil } return nil , fmt . Errorf ( " " , driverName ) }
// IMPLEMENTATION
// MakeHub returns new instance of the pubsub hub.
IMPLEMENTATION MakeHub returns new instance of the pubsub hub .