You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gcppubsub.go
    path of file: ./repos/plumber/backends/gcppubsub
    
    the code of the file until where you have to start completion: package gcppubsub

import (
	"context"

	"cloud.google.com/go/pubsub"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"google.golang.org/api/option"

	"github.com/batchcorp/plumber-schemas/build/go/protos/args"
	"github.com/batchcorp/plumber-schemas/build/go/protos/opts"

	"github.com/streamdal/plumber/types"
	"github.com/streamdal/plumber/validate"
)

const BackendName = "gcp-pubsub"

type GCPPubSub struct {
	// Base connection options / non-backend-specific options
	connOpts *opts.ConnectionOptions

	// Backend-specific args
	connArgs *args.GCPPubSubConn

	client *pubsub.Client

	log *logrus.Entry
}

func New(opts *opts.ConnectionOptions) (*GCPPubSub, error) {
	if err := validateBaseConnOpts(opts); err != nil {
		return nil, errors.Wrap(err, "unable to validate connection options")
	}

	clientOpts := make([]option.ClientOption, 0)

	// Determine how we are authenticating
	if opts.GetGcpPubsub().Credent
    
func New(opts *opts.ConnectionOptions) (*GCPPubSub, error) {
	if err := validateBaseConnOpts(opts); err != nil {
		return nil, errors.Wrap(err, "unable to validate connection options")
	}

	clientOpts := make([]option.ClientOption, 0)

	// Determine how we are authenticating
	if opts.GetGcpPubsub().CredentialsJson != "" {
		// User passed in JSON data
		clientOpts = append(clientOpts, option.WithCredentialsJSON([]byte(opts.GetGcpPubsub().CredentialsJson)))
	} else if opts.GetGcpPubsub().CredentialsFile != "" {
		// User wants to pull credentials from a JSON file
		clientOpts = append(clientOpts, option.WithCredentialsFile(opts.GetGcpPubsub().CredentialsFile))
	}

	client, err := pubsub.NewClient(context.TODO(), opts.GetGcpPubsub().ProjectId, clientOpts...)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create GCP connection")
	}

	return &GCPPubSub{
		connOpts: opts,
		connArgs: opts.GetGcpPubsub(),
		client:   client,
		log:      logrus.WithField("backend", BackendName),
	}, nil
}