func Listen(ctx context.Context, cred string, h MessageHandler, projectID string, topic string, opts ...option.ClientOption) error {
	ts, err := util.TokenSource(ctx, cred, scope)
	if err != nil {
		return fmt.Errorf("getting default token source: %v", err)
	}
	fullOpts := []option.ClientOption{option.WithTokenSource(ts)}
	fullOpts = append(fullOpts, opts...)
	return listen(ctx, h, projectID, topic, fullOpts...)
}
Listen listens for notifications from a pubsub subscription, uses the ids
in the messages to fetch content with the HL7v2 API, then sends the message
to the partner over MLLP.
package pubsub
import (
	"context"
	"fmt"
	"cloud.google.com/go/pubsub"
	"google.golang.org/api/option"
	"github.com/GoogleCloudPlatform/mllp/shared/util"
)
const (
	fetchErrorMetric = "pubsub-messages-fetch-error"
	sendErrorMetric  = "pubsub-messages-send-error"
	processedMetric  = "pubsub-messages-processed"
	ignoredMetric    = "pubsub-messages-ignored"
	scope = "https://www.googleapis.com/auth/pubsub"
)
type Message interface {
	Ack()
	Data() []byte
	Attrs() map[string]string
}
type messageWrapper struct {
	msg *pubsub.Message
}
func (m *messageWrapper) Ack() {
	m.msg.Ack()
}
func (m *messageWrapper) Data() []byte {
	return m.msg.Data
}
func (m *messageWrapper) Attrs() map[string]string {
	return m.msg.Attributes
}
type MessageHandler interface {
	Handle(Message)
}