api

package
v0.0.0-...-57714c1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ORGID      = "a924baea-363a-457e-8708-0eda152e76c5"
	SPACEID    = "1fde0510-cc7e-42c0-8321-1505d51f0c29"
	INSTANCEID = "00000000-0000-0000-0000-000000000000"
	SERVICEID  = "9c372bbc-1e7b-472b-bcb6-eeda5b21eb35"
	PLANID     = "8cfbbaf5-efdb-41c1-89ab-f797185f7818"
)
View Source
const BINDING_ID = "00000000-0000-0000-0000-000000000000"

for curl testing

Variables

View Source
var EmptyJData []byte = []byte("{}")
View Source
var Environment string = "debug"
View Source
var RedisConf = RedisCredentials{
	Network:  "tcp",
	Address:  ":6379",
	Password: "",
	Db:       0,
}
View Source
var SentinelConf = SentinelCredentials{
	MasterName:    "mymaster",
	SentinelAddrs: []string{},
	Password:      "",
	Db:            0,
}

Functions

func HandleBinding

func HandleBinding(w http.ResponseWriter, r *http.Request)

func HandleCatalog

func HandleCatalog(w http.ResponseWriter, r *http.Request)

func HandleServiceInstance

func HandleServiceInstance(w http.ResponseWriter, r *http.Request)

Types

type Binder

type Binder struct {
	Binding ServiceBinding
	Bound   *ServiceBound
}

func NewBinder

func NewBinder(instanceId, bindingId string) *Binder

func (*Binder) Do

func (b *Binder) Do(body io.ReadCloser)

func (*Binder) Result

func (b *Binder) Result() (*bytes.Buffer, error)

type CatalogV2

type CatalogV2 struct {
	Services []ServiceV2 `json:"services" yaml:"services"`
}

type DashboardClientV2

type DashboardClientV2 struct {
	Id          string `json:"id,omitempty" yaml:"id,omitempty"`
	Secret      string `json:"secret,omitempty" yaml:"secret,omitempty"`
	RedirectUri string `json:"redirect_uri,omitempty" yaml:"redirect_uri,omitempty"`
}

type InstanceDashboard

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

type InstancePlan

type InstancePlan struct {
	ServiceId string `json:"service_id" yaml:"service_id"`
	PlanId    string `json:"plan_id" yaml:"plan_id"`
}

type InstancePrevious

type InstancePrevious struct {
	Plan             InstancePlan `json:",inline" yaml:",inline"`
	OrganizationGuid string       `json:"organization_id,omitempty" yaml:"organization_id,omitempty"`
	SpaceGuid        string       `json:"space_id,omitempty" yaml:"space_id,omitempty"`
}

type InstanceUpdation

type InstanceUpdation struct {
	Id         string                 `json:"-" yaml:"-"`
	Current    InstancePlan           `json:",inline" yaml:",inline"`
	Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Previous   InstancePrevious       `json:"previous_values,omitempty" yaml:"previous_values,omitempty"`
}

type PayAmount

type PayAmount struct {
	Usd float64 `json:"usd,omitempty" yaml:"usd,omitempty"`
	Eur float64 `json:"eur,omitempty" yaml:"eur,omitempty"`
}

type PlanMetadata

type PlanMetadata struct {
	Bullets     []string     `json:"free,omitempty" yaml:"free,omitempty"`
	Costs       ServiceCosts `json:"costs,omitempty" yaml:"costs,omitempty"`
	DisplayName string       `json:"displayName,omitempty" yaml:"displayName,omitempty"`
}

type RedisBinder

type RedisBinder struct {
	*Binder
}

func (*RedisBinder) Do

func (b *RedisBinder) Do(body io.ReadCloser)

type RedisCredentials

type RedisCredentials struct {
	Network  string `json:"network,omitempty" schema:"network"`
	Address  string `json:"address,omitempty" schema:"address"`
	Password string `json:"password,omitempty" schema:"password"`
	Db       int    `json:"db,omitempty" schema:"db"`
}

type SentinelBinder

type SentinelBinder struct {
	*Binder
}

func (*SentinelBinder) Do

func (b *SentinelBinder) Do(body io.ReadCloser)

type SentinelCredentials

type SentinelCredentials struct {
	MasterName    string   `json:"mastername,omitempty" schema:"mastername"`
	SentinelAddrs []string `json:"sentineladdrs,omitempty" schema:"sentineladdrs"`
	Password      string   `json:"password,omitempty" schema:"password"`
	Db            int64    `json:"db,omitempty" schema:"db"`
}

type ServiceBinding

type ServiceBinding struct {
	Id         string                 `json:"-" yaml:"-"`
	InstanceId string                 `json:"-" yaml:"-"`
	ServiceId  string                 `json:"service_id" yaml:"service_id"`
	PlanId     string                 `json:"plan_id" yaml:"plan_id"`
	AppGuid    string                 `json:"app_guid,omitempty" yaml:"app_guid,omitempty"`
	Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

type ServiceBound

type ServiceBound struct {
	Credentials    map[string]interface{} `json:"credentials,omitempty" yaml:"credentials,omitempty"`
	SyslogDrainUrl string                 `json:"syslog_drain_url,omitempty" yaml:"syslog_drain_url,omitempty"`
}

type ServiceCatalog

type ServiceCatalog struct {
	// contains filtered or unexported fields
}

func (*ServiceCatalog) DeleteInstance

func (h *ServiceCatalog) DeleteInstance(w http.ResponseWriter, r *http.Request)

func (*ServiceCatalog) Provision

func (h *ServiceCatalog) Provision(w http.ResponseWriter, r *http.Request)

func (*ServiceCatalog) UpdateInstance

func (h *ServiceCatalog) UpdateInstance(w http.ResponseWriter, r *http.Request)

type ServiceCosts

type ServiceCosts struct {
	Amount PayAmount `json:"amount,omitempty" yaml:"amount,omitempty"`
	Unit   string    `json:"unit,omitempty" yaml:"unit,omitempty"`
}

type ServiceInstance

type ServiceInstance struct {
	Id string `json:"-" yaml:"-"`
	//InstancePlan        InstancePlan            `json:",inline"`
	ServiceId        string                 `json:"service_id" yaml:"service_id"`
	PlanId           string                 `json:"plan_id" yaml:"plan_id"`
	OrganizationGuid string                 `json:"organization_guid" yaml:"organization_guid"`
	SpaceGuid        string                 `json:"space_guid" yaml:"space_guid"`
	Parameters       map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

type ServiceMetadata

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

type ServicePlanV2

type ServicePlanV2 struct {
	Id          string        `json:"id" yaml:"id"`
	Name        string        `json:"name" yaml:"name"`
	Description string        `json:"description" yaml:"description"`
	Metadata    *PlanMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Free        bool          `json:"free,omitempty" yaml:"free,omitempty"`
}

type ServiceV2

type ServiceV2 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"`
	Tags            []string           `json:"tags,omitempty" yaml:"tags,omitempty"`
	Metadata        []ServiceMetadata  `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Requires        string             `json:"requires,omitempty" yaml:"requires,omitempty"`
	PlanUpdatable   bool               `json:"plan_updateable,omitempty" yaml:"plan_updateable,omitempty"`
	Plans           []ServicePlanV2    `json:"plans" yaml:"plans"`
	DashboardClient *DashboardClientV2 `json:"dashboard_client,omitempty" yaml:"dashboard_client,omitempty"`
}

Jump to

Keyboard shortcuts

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