code: func New(cnf *config.Config, projectID, subscriptionName string) (iface.Broker, error) {
  	b := &Broker{Broker: common.NewBroker(cnf)}
  	b.subscriptionName = subscriptionName
  
  	ctx := context.Background()
  
  	if cnf.GCPPubSub != nil {
  		b.MaxExtension = cnf.GCPPubSub.MaxExtension
  	}
  
  	if cnf.GCPPubSub != nil && cnf.GCPPubSub.Client != nil {
  		b.service = cnf.GCPPubSub.Client
  	} else {
  		pubsubClient, err := pubsub.NewClient(ctx, projectID)
  		if err != nil {
  			return nil, err
  		}
  		b.service = pubsubClient
  		cnf.GCPPubSub = &config.GCPPubSubConfig{
  			Client: pubsubClient,
  		}
  	}
  
  	// Validate topic exists
  	defaultQueue := b.GetConfig().DefaultQueue
  	topic := b.service.Topic(defaultQueue)
  	defer topic.Stop()
  
  	topicExists, err := topic.Exists(ctx)
  	if err != nil {
  		return nil, err
  	}
  	if !topicExists {
  		return nil, fmt.Errorf("topic does not exist, instead got %s", defaultQueue)
  	}
  
  	// Validate subscription exists
  	sub := b.service.Subscription(b.subscriptionName)
  
  	if b.MaxExtension != 0 {
  		sub.ReceiveSettings.MaxExtension = b.MaxExtension
  	}
  
  	subscriptionExists, err := sub.Exists(ctx)
  	if err != nil {
  		return nil, err
  	}
  	if !subscriptionExists {
  		return nil, fmt.Errorf("subscription does not exist, instead got %s", b.subscriptionName)
  	}
  
  	return b, nil
  }
docs: // New creates new Broker instance