broker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 16 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
	APIConfig      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) LastOperationOnInstance

func (b *Broker) LastOperationOnInstance(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)

func (*Broker) UpdateInstance

func (b *Broker) UpdateInstance(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" yaml:"instances_retrievable"`
	BindingsRetrievable  bool     `json:"bindings_retrievable" yaml:"bindings_retrievable"`
	PlanUpdateable       bool     `json:"plan_updateable" yaml:"plan_updateable"`
	Tags                 []string `json:"tags" yaml:"tags"`
	Metadata             struct {
		DisplayName         string `json:"displayName" yaml:"displayName"`
		ImageURL            string `json:"imageUrl,omitempty" yaml:"imageUrl,omitempty"`
		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 ServiceBindingResponse

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

type ServiceBindingResponseCredentials

type ServiceBindingResponseCredentials struct {
	Direct        []string    `json:"direct"`
	CLI           interface{} `json:"cli,omitempty"`
	Maps          interface{} `json:"maps,omitempty"`
	SSH           interface{} `json:"ssh,omitempty"`
	Health        interface{} `json:"health,omitempty"`
	Admin         interface{} `json:"admin,omitempty"`
	URI           string      `json:"uri,omitempty"`
	URL           string      `json:"url,omitempty"`
	DatabaseURI   string      `json:"database_uri,omitempty"`
	Username      string      `json:"username,omitempty"`
	Password      string      `json:"password,omitempty"`
	Database      string      `json:"database,omitempty"`
	Scheme        string      `json:"scheme,omitempty"`
	Host          string      `json:"host,omitempty"`
	Hostname      string      `json:"hostname,omitempty"`
	Port          int         `json:"port,omitempty"`
	CACertificate string      `json:"ca_certificate,omitempty"`
}

type ServiceBindingResponseEndpoint

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

type ServiceBindingResponseParameters

type ServiceBindingResponseParameters struct {
	Deployment api.Deployment `json:"deployment"`
	Scaling    api.Scaling    `json:"scaling,omitempty"`
}

type ServiceCatalog

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

func LoadServiceCatalog

func LoadServiceCatalog(filename string) *ServiceCatalog

type ServiceInstanceFetchResponse

type ServiceInstanceFetchResponse struct {
	DashboardURL string                                 `json:"dashboard_url"`
	Parameters   ServiceInstanceFetchResponseParameters `json:"parameters"`
}

type ServiceInstanceFetchResponseParameters

type ServiceInstanceFetchResponseParameters struct {
	Deployment api.Deployment `json:"deployment"`
	Scaling    api.Scaling    `json:"scaling"`
}

type ServiceInstanceOperationResponse

type ServiceInstanceOperationResponse struct {
	State       string `json:"state"`
	Description string `json:"description,omitempty"`
}

type ServiceInstanceProvisioning

type ServiceInstanceProvisioning struct {
	ServiceID  string `json:"service_id"`
	PlanID     string `json:"plan_id"`
	Parameters struct {
		AccountID  string `json:"account_id"`
		Datacenter string `json:"datacenter"`
		Version    string `json:"version"`
		Units      int    `json:"units"`
		CacheMode  bool   `json:"cache_mode"`
	} `json:"parameters"`
}

type ServiceInstanceProvisioningResponse

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

type ServiceInstanceUpdate

type ServiceInstanceUpdate struct {
	ServiceID  string `json:"service_id"`
	PlanID     string `json:"plan_id"`
	Parameters struct {
		Units int `json:"units"`
	} `json:"parameters"`
}

type ServiceInstanceUpdateResponse

type ServiceInstanceUpdateResponse 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,omitempty" yaml:"imageUrl,omitempty"`
		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"`
		HighAvailability bool     `json:"highAvailability" yaml:"highAvailability"`
		Units            int      `json:"units" yaml:"units"`
		CacheMode        bool     `json:"cache_mode,omitempty" yaml:"cache_mode,omitempty"`
		Version          string   `json:"version,omitempty" yaml:"version,omitempty"`
		Datacenter       string   `json:"datacenter,omitempty" yaml:"datacenter,omitempty"`
	} `json:"metadata" yaml:"metadata"`
}

Jump to

Keyboard shortcuts

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