adapter

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Name     string   `json:"name"`
	Title    string   `json:"title,omitempty"`
	Catalogs []string `json:"catalogs"`
	URL      *string  `json:"url,omitempty"`
}

Broker represents a Service Broker.

type BrokerError

type BrokerError struct {
	// StatusCode is the HTTP status code returned by the broker.
	StatusCode int
	// ErrorDescription describes the failed result of the request.
	ErrorDescription string
	// ErrorBody is the response body returned by the broker.
	ErrorBody string
}

BrokerError is the result of a failed broker request.

func (*BrokerError) Error

func (e *BrokerError) Error() string

Error is the method inherited from "error" interface to print the error.

type CreateBrokerParams

type CreateBrokerParams struct {
	URL     string
	Project string
	Name    string
	Title   string
}

CreateBrokerParams is used as input to CreateBroker.

type DoClient

type DoClient interface {
	Do(*http.Request) (*http.Response, error)
}

type GetCatalogParams

type GetCatalogParams struct {
	URL     string
	Project string
	Name    string
}

GetCatalogParams is used as input to GetCatalog.

type GetCatalogResult

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

GetCatalogResult is output of successful GetCatalog request.

type HttpAdapter

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

HttpAdapter is an implementation of Adapter that uses HTTP.

func NewHttpAdapter

func NewHttpAdapter(client DoClient) *HttpAdapter

NewHttpAdapter returns an *HttpAdapter which uses the given client.

func (*HttpAdapter) CreateBroker

func (adapter *HttpAdapter) CreateBroker(params *CreateBrokerParams) (int, []byte, error)

CreateBroker creates a broker in project with the given name, title, and catalogs using the URL.

func (*HttpAdapter) GetCatalog

func (adapter *HttpAdapter) GetCatalog(params *GetCatalogParams) (*GetCatalogResult, error)

type Service

type Service struct {
	ID string `json:"id"`
}

Service corresponds to the Service Object in the Open Service Broker API.

Jump to

Keyboard shortcuts

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