func (gcpBroker *GCPServiceBroker) Services(ctx context.Context) ([]brokerapi.Service, error) {
	svcs := []brokerapi.Service{}
	enabledServices, err := gcpBroker.registry.GetEnabledServices()
	if err != nil {
		return nil, err
	}
	for _, service := range enabledServices {
		entry, err := service.CatalogEntry()
		if err != nil {
			return svcs, err
		}
		svcs = append(svcs, entry.ToPlain())
	}
	return svcs, nil
}
Services lists services in the broker's catalog.
It is called through the `GET /v2/catalog` endpoint or the `cf marketplace` command.
package brokers
import (
	"context"
	"errors"
	"fmt"
	"net/http"
	"code.cloudfoundry.org/lager"
	"github.com/pivotal-cf/brokerapi"
	"golang.org/x/oauth2/jwt"
	"google.golang.org/api/googleapi"
	"encoding/json"
	"github.com/GoogleCloudPlatform/gcp-service-broker/db_service"
	"github.com/GoogleCloudPlatform/gcp-service-broker/db_service/models"
	"github.com/GoogleCloudPlatform/gcp-service-broker/pkg/broker"
)
var (
	invalidUserInputMsg        = "User supplied paramaters must be in the form of a valid JSON map."
	ErrInvalidUserInput        = brokerapi.NewFailureResponse(errors.New(invalidUserInputMsg), http.StatusBadRequest, "parsing-user-request")
	ErrGetInstancesUnsupported = brokerapi.NewFailureResponse(errors.New("the service_instances endpoint is unsupported"), http.StatusBadRequest, "unsupported")
	ErrGetBindingsUnsupported  = brokerapi.NewFailureResponse(errors.New("the service_bindings endpoint is unsupported"), http.StatusBadRequest, "unsupported")
)
type GCPServiceBroker struct {
	registry  broker.BrokerRegistry
	jwtConfig *jwt.Config
	projectId string
	Logger lager.Logger
}
func New(cfg *BrokerConfig, logger lager.Logger) (*GCPServiceBroker, error) {
	return &GCPServiceBroker{
		registry:  cfg.Registry,
		jwtConfig: cfg.HttpConfig,
		projectId: cfg.ProjectId,
		Logger:    logger,
	}, nil
}