broker

package
v0.0.0-...-d347a91 Latest Latest
Warning

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

Go to latest
Published: May 28, 2014 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Raised by Broker Service if service instance or service instance binding already exists
	ErrCodeConflict = 10
	// Raised by Broker Service if service instance or service instance binding cannot be found
	ErrCodeGone = 20
	// Raised by Broker Service for any other issues
	ErrCodeOther = 99
)

Variables

View Source
var RandomPasswordGenerator = &randomGenerator{16, base64.URLEncoding}
View Source
var UsageStr = `` /* 634-byte string literal not displayed */

Functions

func New

func New(o Options, bs BrokerService) *broker

Types

type BindingRequest

type BindingRequest struct {
	InstanceId string `json:"-"`
	BindingId  string `json:"-"`
	ServiceId  string `json:"service_id"`
	PlanId     string `json:"plan_id"`
	AppId      string `json:"app_guid"`
}

See http://docs.cloudfoundry.com/docs/running/architecture/services/api.html#binding

type BrokerError

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

Other types

type BrokerService

type BrokerService interface {

	// Exposes the catalog of services managed by this broker.
	// Returns the exposed catalog.
	Catalog() (Catalog, error)

	// Creates a service instance of a specified service and plan.
	// Returns the optional management URL.
	Provision(ProvisioningRequest) (string, error)

	// Removes created service instance.
	Deprovision(ProvisioningRequest) error

	// Binds to specified service instance.
	// Returns  credentials necessary to establish connection to this
	// service instance as well as optional syslog drain URL.
	Bind(BindingRequest) (Credentials, string, error)

	// Removes created binding.
	Unbind(BindingRequest) error
}

The BrokerService defines the internal API used by the broker's HTTP endpoints.

type BrokerServiceError

type BrokerServiceError interface {
	Code() int
	Error() string
}

type Credentials

type Credentials map[string]interface{}

type Options

type Options struct {
	Host     string
	Port     int
	Username string
	Password string
	Debug    bool
	LogFile  string
	Trace    bool
	PidFile  string
}
var Opts Options = Options{}

type PasswordGenerator

type PasswordGenerator interface {
	GeneratePassword() (string, error)
}

type Plan

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

See http://docs.cloudfoundry.com/docs/running/architecture/services/api.html#catalog-mgmt

type ProvisioningRequest

type ProvisioningRequest struct {
	InstanceId string `json:"-"`
	ServiceId  string `json:"service_id"`
	PlanId     string `json:"plan_id"`
	OrgId      string `json:"organization_guid"`
	SpaceId    string `json:"space_guid"`
}

See http://docs.cloudfoundry.com/docs/running/architecture/services/api.html#provisioning

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"`
	Requires    []string               `json:"requires,omitempty"`
	Plans       []Plan                 `json:"plans"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

See http://docs.cloudfoundry.com/docs/running/architecture/services/api.html#catalog-mgmt

Jump to

Keyboard shortcuts

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