servicebroker

package module
v0.0.0-...-3d3bd30 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2014 License: MIT Imports: 10 Imported by: 0

README

Provides the Cloud Foundry API scaffolding for service brokers written in go.

Install

go get github.com/pivotalservices/servicebroker
cd $GOPATH/src/github.com/pivotalservices/servicebroker && godep get

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 409 HTTP status code should be returned if the requested service instance already exists.
	ErrServiceInstanceAlreadyExists = errors.New("Service instance already exists")
	// 500 HTTP status code should be returned if the instance limit for this service has been reached.
	ErrServiceInstanceLimitReached = errors.New("Maximum number of instances for this service has been reached")
	// 409 HTTP status code should be returned if the service instance does not exist when attempting to bind to it.
	ErrServiceInstanceDoesNotExists = errors.New("Service instance does not exists")
	// 409 HTTP status code should be returned if the requested binding already exists
	ErrServiceInstanceBindingAlreadyExists = errors.New("Binding already exists")
)

Service Broker API Errors

Functions

func BasicAuthCheck

func BasicAuthCheck() http.HandlerFunc

func NewAPI

func NewAPI(serviceBroker ServiceBroker, logger lager.Logger) *martini.ClassicMartini

Creates v2 service broker api for a given broker

Types

type BindingResponse

type BindingResponse struct {
	Credentials interface{} `json:"credentials"`
}

type CatalogResponse

type CatalogResponse struct {
	Services []Service `json:"services"`
}

type DashboardClient

type DashboardClient struct {
	Id          string `json:"id"`
	Secret      string `json:"secret"`
	RedirectUri string `json:"redirect_uri"`
}

type EmptyResponse

type EmptyResponse struct{}

type ErrorResponse

type ErrorResponse struct {
	Description string `json:"description"`
}

type Plan

type Plan struct {
	Id          string       `json:"id"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Metadata    PlanMetadata `json:"metadata,omitempty"`
}

type PlanMetadata

type PlanMetadata struct {
	Bullets     []string `json:"bullets"`
	DisplayName string   `json:"displayName"`
}

type ProvisionRequest

type ProvisionRequest struct {
	ServiceId        string `json:"service_id"`
	PlanId           string `json:"plan_id"`
	OrganizationGuid string `json:"organization_guid"`
	SpaceGuid        string `json:"space_guid"`
}

type ProvisionResponse

type ProvisionResponse struct {
	DashboardUrl string `json:"dashboard_url,omitempty"`
}

type Service

type Service struct {
	Id              string          `json:"id"`
	Name            string          `json:"name"`
	Description     string          `json:"description"`
	Bindable        bool            `json:"bindable"`
	Plans           []Plan          `json:"plans"`
	Metadata        ServiceMetadata `json:"metadata,omitempty"`
	Tags            []string        `json:"tags,omitempty"`
	DashboardClient DashboardClient `json:"dashboard_client"`
}

type ServiceBroker

type ServiceBroker interface {
	// Fetches the service catalog for the developer to select from the marketplace
	// http://docs.cloudfoundry.org/services/api.html#catalog-mgmt
	GetCatalog() []Service

	// Creates a new service resource for the developer
	// http://docs.cloudfoundry.org/services/api.html#provisioning
	Provision(instanceId string, params map[string]string) (string, error)

	// Creates a binding to a provisioned service instance for an application to use for connecting to the instance
	// http://docs.cloudfoundry.org/services/api.html#binding
	Bind(instanceId string, bindingId string) (interface{}, error)

	// Removes a service instance binding so applications can no longer bind to that instance
	// http://docs.cloudfoundry.org/services/api.html#unbinding
	Unbind(instanceId string, bindingId string) error

	// Deletes a provisioned service instance completely so users can no longer use it
	// http://docs.cloudfoundry.org/services/api.html#deprovisioning
	Deprovision(instanceId string) error
}

Implements the Cloud Foundry Service Broker API http://docs.cloudfoundry.org/services/api.html#api-overview

type ServiceMetadata

type ServiceMetadata struct {
	DisplayName      string                  `json:"displayName"`
	LongDescription  string                  `json:"longDescription"`
	DocumentationUrl string                  `json:"documentationUrl"`
	SupportUrl       string                  `json:"supportUrl"`
	Listing          ServiceMetadataListing  `json:"listing"`
	Provider         ServiceMetadataProvider `json:"provider"`
}

type ServiceMetadataListing

type ServiceMetadataListing struct {
	Blurb    string `json:"blurb"`
	ImageUrl string `json:"imageUrl"`
}

type ServiceMetadataProvider

type ServiceMetadataProvider struct {
	Name string `json:"name"`
}

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/inject
Package inject provides utilities for mapping and injecting dependencies in various ways.
Package inject provides utilities for mapping and injecting dependencies in various ways.
_workspace/src/github.com/go-martini/martini
Package martini is a powerful package for quickly writing modular web applications/services in Golang.
Package martini is a powerful package for quickly writing modular web applications/services in Golang.
_workspace/src/github.com/martini-contrib/binding
Package binding transforms a raw request into a struct ready to be used your application.
Package binding transforms a raw request into a struct ready to be used your application.
_workspace/src/github.com/martini-contrib/render
Package render is a middleware for Martini that provides easy JSON serialization and HTML template rendering.
Package render is a middleware for Martini that provides easy JSON serialization and HTML template rendering.
_workspace/src/github.com/onsi/ginkgo
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
_workspace/src/github.com/onsi/ginkgo/config
Ginkgo accepts a number of configuration options.
Ginkgo accepts a number of configuration options.
_workspace/src/github.com/onsi/ginkgo/ginkgo
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
_workspace/src/github.com/onsi/ginkgo/internal/remote
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
_workspace/src/github.com/onsi/ginkgo/reporters
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
_workspace/src/github.com/onsi/gomega
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
_workspace/src/github.com/onsi/gomega/format
Gomega's format package pretty-prints objects.
Gomega's format package pretty-prints objects.
_workspace/src/github.com/onsi/gomega/gbytes
Package gbytes provides a buffer that supports incrementally detecting input.
Package gbytes provides a buffer that supports incrementally detecting input.
_workspace/src/github.com/onsi/gomega/gexec
Package gexec provides support for testing external processes.
Package gexec provides support for testing external processes.
_workspace/src/github.com/onsi/gomega/ghttp
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
_workspace/src/github.com/onsi/gomega/matchers
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
_workspace/src/github.com/oxtoacart/bpool
Package bpool implements leaky pools of byte arrays and Buffers as bounded channels.
Package bpool implements leaky pools of byte arrays and Buffers as bounded channels.

Jump to

Keyboard shortcuts

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