broker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(c *config.Config) *mux.Router

Types

type Broker

type Broker struct {
	Username       string
	Password       string
	API            config.API
	Client         *api.Client
	ServiceCatalog *ServiceCatalog
}

func NewBroker

func NewBroker(c *config.Config) *Broker

func (*Broker) BasicAuth

func (b *Broker) BasicAuth(handler http.HandlerFunc) http.HandlerFunc

func (*Broker) Bind

func (b *Broker) Bind(rw http.ResponseWriter, req *http.Request)

func (*Broker) Catalog

func (b *Broker) Catalog(rw http.ResponseWriter, req *http.Request)

func (*Broker) DeprovisionInstance

func (b *Broker) DeprovisionInstance(rw http.ResponseWriter, req *http.Request)

func (*Broker) Error

func (b *Broker) Error(rw http.ResponseWriter, req *http.Request, code int, err, desc string)

func (*Broker) FetchBinding

func (b *Broker) FetchBinding(rw http.ResponseWriter, req *http.Request)

func (*Broker) FetchInstance

func (b *Broker) FetchInstance(rw http.ResponseWriter, req *http.Request)

func (*Broker) Health

func (b *Broker) Health(rw http.ResponseWriter, req *http.Request)

func (*Broker) ProvisionInstance

func (b *Broker) ProvisionInstance(rw http.ResponseWriter, req *http.Request)

func (*Broker) Unbind

func (b *Broker) Unbind(rw http.ResponseWriter, req *http.Request)

type Service

type Service struct {
	ID                   string   `json:"id" yaml:"id"`
	Name                 string   `json:"name" yaml:"name"`
	Description          string   `json:"description" yaml:"description"`
	Bindable             bool     `json:"bindable" yaml:"bindable"`
	InstancesRetrievable bool     `json:"instances_retrievable"`
	BindingsRetrievable  bool     `json:"bindings_retrievable"`
	Tags                 []string `json:"tags" yaml:"tags"`
	Metadata             struct {
		DisplayName         string `json:"displayName" yaml:"displayName"`
		ImageURL            string `json:"imageUrl" yaml:"imageUrl"`
		LongDescription     string `json:"longDescription" yaml:"longDescription"`
		ProviderDisplayName string `json:"providerDisplayName" yaml:"providerDisplayName"`
		DocumentationURL    string `json:"documentationUrl" yaml:"documentationUrl"`
		SupportURL          string `json:"supportUrl" yaml:"supportUrl"`
	} `json:"metadata" yaml:"metadata"`
	Plans []ServicePlan `json:"plans" yaml:"plans"`
}

type ServiceBinding

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

type ServiceBindingResponse

type ServiceBindingResponse struct {
	Credentials ServiceBindingResponseCredentials `json:"credentials"`
	Endpoints   []ServiceBindingResponseEndpoint  `json:"endpoints"`
	Parameters  ServiceBindingResponseParameters  `json:"parameters"`
}

func ParseBinding

func ParseBinding(instance *api.InstanceInfo) ServiceBindingResponse

type ServiceBindingResponseCredentials

type ServiceBindingResponseCredentials struct {
	URI         string `json:"uri"`
	URL         string `json:"url"`
	DatabaseURI string `json:"database_uri"`
	APIKey      string `json:"apikey"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	Database    string `json:"database"`
	Scheme      string `json:"scheme"`
	Host        string `json:"host"`
	Hostname    string `json:"hostname"`
	Port        int    `json:"port"`
}

type ServiceBindingResponseEndpoint

type ServiceBindingResponseEndpoint struct {
	Host  string   `json:"host"`
	Ports []string `json:"ports"`
}

type ServiceBindingResponseParameters

type ServiceBindingResponseParameters struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Plan   string `json:"plan"`
	Region string `json:"region"`
}

type ServiceCatalog

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

func LoadServiceCatalog

func LoadServiceCatalog(filename string) *ServiceCatalog

type ServiceInstanceFetchResponse

type ServiceInstanceFetchResponse struct {
	ServiceID    string                                 `json:"service_id,omitempty"`
	PlanID       string                                 `json:"plan_id,omitempty"`
	DashboardURL string                                 `json:"dashboard_url"`
	Parameters   ServiceInstanceFetchResponseParameters `json:"parameters"`
}

type ServiceInstanceFetchResponseParameters

type ServiceInstanceFetchResponseParameters struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Plan   string `json:"plan"`
	Region string `json:"region"`
}

type ServiceInstanceProvisioning

type ServiceInstanceProvisioning struct {
	ServiceID  string `json:"service_id"`
	PlanID     string `json:"plan_id"`
	Parameters struct {
		Region string `json:"region"`
	} `json:"parameters"`
}

type ServiceInstanceProvisioningResponse

type ServiceInstanceProvisioningResponse struct {
	DashboardURL string `json:"dashboard_url"`
}

type ServicePlan

type ServicePlan struct {
	ID          string `json:"id" yaml:"id"`
	Name        string `json:"name" yaml:"name"`
	Description string `json:"description" yaml:"description"`
	Free        bool   `json:"free" yaml:"free"`
	Bindable    bool   `json:"bindable" yaml:"bindable"`
	Metadata    struct {
		DisplayName string `json:"displayName" yaml:"displayName"`
		ImageURL    string `json:"imageUrl" yaml:"imageUrl"`
		Costs       []struct {
			Amount struct {
				USDollar float64 `json:"usd" yaml:"usd"`
			} `json:"amount" yaml:"amount"`
			Unit string `json:"unit" yaml:"unit"`
		} `json:"costs" yaml:"costs"`
		Bullets          []string `json:"bullets" yaml:"bullets"`
		DedicatedService bool     `json:"dedicatedService" yaml:"dedicatedService"`
		HighAvailability bool     `json:"highAvailability" yaml:"highAvailability"`
	} `json:"metadata" yaml:"metadata"`
}

Jump to

Keyboard shortcuts

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