models

package
v3.3.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermissionRouteForwarding = RequiredPermission("route_forwarding")
	PermissionSyslogDrain     = RequiredPermission("syslog_drain")
)
View Source
const AppCredsEnvVar = "GOOGLE_APPLICATION_CREDENTIALS"
View Source
const AppCredsFileName = "application-default-credentials.json"
View Source
const BigqueryName = "google-bigquery"
View Source
const BigtableName = "google-bigtable"
View Source
const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
View Source
const CloudsqlName = "google-cloudsql"
View Source
const MlName = "google-ml-apis"
View Source
const PubsubName = "google-pubsub"
View Source
const RootSaEnvVar = "ROOT_SERVICE_ACCOUNT_JSON"
View Source
const SpannerName = "google-spanner"
View Source
const StackdriverDebuggerName = "google-stackdriver-debugger"
View Source
const StackdriverTraceName = "google-stackdriver-trace"
View Source
const StorageName = "google-storage"

Variables

View Source
var (
	ErrInstanceAlreadyExists  = errors.New("instance already exists")
	ErrInstanceDoesNotExist   = errors.New("instance does not exist")
	ErrInstanceLimitMet       = errors.New("instance limit for this service has been reached")
	ErrPlanQuotaExceeded      = errors.New("The quota for this service plan has been exceeded. Please contact your Operator for help.")
	ErrBindingAlreadyExists   = errors.New("binding already exists")
	ErrBindingDoesNotExist    = errors.New("binding does not exist")
	ErrAsyncRequired          = errors.New("This service plan requires client support for asynchronous service operations.")
	ErrServiceIsNotAsync      = errors.New("This service is not provisioned asynchronously; this operation does not apply.")
	ErrPlanChangeNotSupported = errors.New("The requested plan migration cannot be performed")
	ErrRawParamsInvalid       = errors.New("The format of the parameters is not valid JSON")
	ErrAppGuidNotProvided     = errors.New("app_guid is a required field but was not provided")
)
View Source
var CustomUserAgent = "cf-gcp-service-broker-test 3.3.0"

This custom user agent string is added to provision calls so that Google can track the aggregated use of this tool We can better advocate for devoting resources to supporting cloud foundry and this service broker if we can show good usage statistics for it, so if you feel the need to fork this repo, please leave this string in place!

Functions

func FreeValue

func FreeValue(v bool) *bool

func ProductionizeUserAgent

func ProductionizeUserAgent()

Types

type AccountManager

type AccountManager interface {
	CreateAccountInGoogle(instanceID string, bindingID string, details BindDetails, instance ServiceInstanceDetails) (ServiceBindingCredentials, error)
	DeleteAccountFromGoogle(creds ServiceBindingCredentials) error
	BuildInstanceCredentials(bindDetails map[string]string, instanceDetails map[string]string) map[string]string
}

type BindDetails

type BindDetails struct {
	AppGUID      string                 `json:"app_guid"`
	PlanID       string                 `json:"plan_id"`
	ServiceID    string                 `json:"service_id"`
	BindResource *BindResource          `json:"bind_resource,omitempty"`
	Parameters   map[string]interface{} `json:"parameters,omitempty"`
}

type BindResource

type BindResource struct {
	AppGuid string `json:"app_guid,omitempty"`
	Route   string `json:"route,omitempty"`
}

type Binding

type Binding struct {
	Credentials     interface{} `json:"credentials"`
	SyslogDrainURL  string      `json:"syslog_drain_url,omitempty"`
	RouteServiceURL string      `json:"route_service_url,omitempty"`
}

type CloudOperation

type CloudOperation struct {
	gorm.Model

	Name          string
	Status        string
	OperationType string
	ErrorMessage  string
	InsertTime    string
	StartTime     string
	TargetId      string
	TargetLink    string

	ServiceId         string
	ServiceInstanceId string
}

type DeprovisionDetails

type DeprovisionDetails struct {
	PlanID    string `json:"plan_id"`
	ServiceID string `json:"service_id"`
}

type GCPCredentials

type GCPCredentials struct {
	Type                string `json:"type"`
	ProjectId           string `json:"project_id"`
	PrivateKeyId        string `json:"private_key_id"`
	PrivateKey          string `json:"private_key"`
	ClientEmail         string `json:"client_email"`
	ClientId            string `json:"client_id"`
	AuthUri             string `json:"auth_uri"`
	TokenUri            string `json:"token_uri"`
	AuthProviderCertUrl string `json:"auth_provider_x509_cert_url"`
	ClientCertUrl       string `json:"client_x509_cert_url"`
}

type IsAsync

type IsAsync bool

type LastOperation

type LastOperation struct {
	State       LastOperationState
	Description string
}

type LastOperationState

type LastOperationState string
const (
	InProgress LastOperationState = "in progress"
	Succeeded  LastOperationState = "succeeded"
	Failed     LastOperationState = "failed"
)

type Migration

type Migration struct {
	gorm.Model

	MigrationId int
}

type PlanDetails

type PlanDetails struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	ServiceId string
	Name      string
	Features  string `sql:"type:text"`
}

type PreviousValues

type PreviousValues struct {
	PlanID    string `json:"plan_id"`
	ServiceID string `json:"service_id"`
	OrgID     string `json:"organization_id"`
	SpaceID   string `json:"space_id"`
}

type ProvisionDetails

type ProvisionDetails struct {
	ServiceID        string          `json:"service_id"`
	PlanID           string          `json:"plan_id"`
	OrganizationGUID string          `json:"organization_guid"`
	SpaceGUID        string          `json:"space_guid"`
	RawParameters    json.RawMessage `json:"parameters,omitempty"`
}

type ProvisionRequestDetails

type ProvisionRequestDetails struct {
	gorm.Model

	ServiceInstanceId string
	// is a json.Marshal of models.ProvisionDetails
	RequestDetails string
}

type ProvisionedServiceSpec

type ProvisionedServiceSpec struct {
	IsAsync      bool
	DashboardURL string
}

type RequiredPermission

type RequiredPermission string

type Service

type Service struct {
	ID              string                  `json:"id"`
	Name            string                  `json:"name"`
	Description     string                  `json:"description"`
	Bindable        bool                    `json:"bindable"`
	Tags            []string                `json:"tags,omitempty"`
	PlanUpdatable   bool                    `json:"plan_updateable"`
	Plans           []ServicePlan           `json:"plans"`
	Requires        []RequiredPermission    `json:"requires,omitempty"`
	Metadata        *ServiceMetadata        `json:"metadata,omitempty"`
	DashboardClient *ServiceDashboardClient `json:"dashboard_client,omitempty"`
}

type ServiceBindingCredentials

type ServiceBindingCredentials struct {
	gorm.Model

	OtherDetails string `sql:"type:text"`

	ServiceId         string
	ServiceInstanceId string
	BindingId         string
}

type ServiceBroker

type ServiceBroker interface {
	Services() []Service

	Provision(instanceID string, details ProvisionDetails, asyncAllowed bool) (ProvisionedServiceSpec, error)
	Deprovision(instanceID string, details DeprovisionDetails, asyncAllowed bool) (IsAsync, error)

	Bind(instanceID, bindingID string, details BindDetails) (Binding, error)
	Unbind(instanceID, bindingID string, details UnbindDetails) error

	Update(instanceID string, details UpdateDetails, asyncAllowed bool) (IsAsync, error)

	LastOperation(instanceID string) (LastOperation, error)
}

type ServiceBrokerHelper

type ServiceBrokerHelper interface {
	Provision(instanceId string, details ProvisionDetails, plan PlanDetails) (ServiceInstanceDetails, error)
	Bind(instanceID, bindingID string, details BindDetails) (ServiceBindingCredentials, error)
	BuildInstanceCredentials(bindDetails map[string]string, instanceDetails map[string]string) map[string]string
	Unbind(details ServiceBindingCredentials) error
	Deprovision(instanceID string, details DeprovisionDetails) error
	PollInstance(instanceID string) (bool, error)
	LastOperationWasDelete(instanceID string) (bool, error)
	ProvisionsAsync() bool
	DeprovisionsAsync() bool
}

type ServiceDashboardClient

type ServiceDashboardClient struct {
	ID          string `json:"id"`
	Secret      string `json:"secret"`
	RedirectURI string `json:"redirect_uri"`
}

type ServiceInstanceDetails

type ServiceInstanceDetails struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	Name         string
	Location     string
	Url          string
	OtherDetails string `sql:"type:text"`

	ServiceId        string
	PlanId           string
	SpaceGuid        string
	OrganizationGuid string
}

type ServiceMetadata

type ServiceMetadata struct {
	DisplayName         string `json:"displayName,omitempty"`
	ImageUrl            string `json:"imageUrl,omitempty"`
	LongDescription     string `json:"longDescription,omitempty"`
	ProviderDisplayName string `json:"providerDisplayName,omitempty"`
	DocumentationUrl    string `json:"documentationUrl,omitempty"`
	SupportUrl          string `json:"supportUrl,omitempty"`
}

type ServicePlan

type ServicePlan struct {
	ID          string               `json:"id"`
	Name        string               `json:"name"`
	Description string               `json:"description"`
	Free        *bool                `json:"free,omitempty"`
	Metadata    *ServicePlanMetadata `json:"metadata,omitempty"`
}

type ServicePlanCost

type ServicePlanCost struct {
	Amount map[string]float64 `json:"amount"`
	Unit   string             `json:"unit"`
}

type ServicePlanMetadata

type ServicePlanMetadata struct {
	DisplayName string            `json:"displayName,omitempty"`
	Bullets     []string          `json:"bullets,omitempty"`
	Costs       []ServicePlanCost `json:"costs,omitempty"`
}

type UnbindDetails

type UnbindDetails struct {
	PlanID    string `json:"plan_id"`
	ServiceID string `json:"service_id"`
}

type UpdateDetails

type UpdateDetails struct {
	ServiceID      string                 `json:"service_id"`
	PlanID         string                 `json:"plan_id"`
	Parameters     map[string]interface{} `json:"parameters"`
	PreviousValues PreviousValues         `json:"previous_values"`
}

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL