Documentation ¶
Index ¶
- func HTTPErrorFromResponse(statusCode int, body []byte, url string, method string, contentType string) error
- type AdaptCredentialsRequest
- type BindRequest
- type BindResponse
- type Catalog
- type Credentials
- type DataRequest
- type DataResponse
- type Endpoint
- type EndpointMapping
- type HTTPError
- type NetworkDataRequest
- type NetworkDataResponse
- type NetworkProfile
- type Plan
- type PostgresCredentials
- type ProvisionRequest
- type ProvisionResponse
- type RabbitMQCredentials
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdaptCredentialsRequest ¶
type AdaptCredentialsRequest struct { Credentials Credentials `json:"credentials"` EndpointMappings []EndpointMapping `json:"endpoint_mappings"` }
AdaptCredentialsRequest in accordance with OSB-spec
type BindRequest ¶
type BindRequest struct { AdditionalProperties additionalProperties NetworkData NetworkDataRequest }
BindRequest represents a bind request according to OSB-spec
func (BindRequest) MarshalJSON ¶
func (bindRequest BindRequest) MarshalJSON() ([]byte, error)
MarshalJSON from BindRequest
func (*BindRequest) UnmarshalJSON ¶
func (bindRequest *BindRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON to BindRequest
type BindResponse ¶
type BindResponse struct { AdditionalProperties additionalProperties NetworkData NetworkDataResponse Credentials Credentials Endpoints []Endpoint }
BindResponse represents a response to an OSB-bind
func Adapt ¶
func Adapt(credentials Credentials, endpointMappings []EndpointMapping) (*BindResponse, error)
Adapt credentials according to the specified EndpointMapping
func (BindResponse) MarshalJSON ¶
func (bindResponse BindResponse) MarshalJSON() ([]byte, error)
MarshalJSON from BindResponse
func (*BindResponse) UnmarshalJSON ¶
func (bindResponse *BindResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON to a BindResponse
type Catalog ¶
type Catalog struct {
Services []Service `json:"services"`
}
Catalog represents an osb-catalog
type Credentials ¶
type Credentials struct { AdditionalProperties additionalProperties Endpoints []Endpoint }
Credentials to be used in OSB-calls (credentials are a free-form hash)
func PostgresCredentialsConverter ¶
func PostgresCredentialsConverter(credentials Credentials, endpointMappings []EndpointMapping) (*Credentials, error)
PostgresCredentialsConverter converts to postgresCredentials and adapts endpoints
func RabbitMQCredentialsConverter ¶
func RabbitMQCredentialsConverter(credentials Credentials, endpointMappings []EndpointMapping) (*Credentials, error)
RabbitMQCredentialsConverter converts to RabbitMQCredentials and adapts endpoints
func (Credentials) MarshalJSON ¶
func (credentials Credentials) MarshalJSON() ([]byte, error)
MarshalJSON from Credentials to bytes
func (*Credentials) UnmarshalJSON ¶
func (credentials *Credentials) UnmarshalJSON(b []byte) error
UnmarshalJSON to Credentials
type DataRequest ¶
type DataRequest struct {
ConsumerID string `json:"consumer_id"`
}
DataRequest represents the data section of an osb-NetworkProfile in a request
type DataResponse ¶
type DataResponse struct { ProviderID string `json:"provider_id"` Endpoints []Endpoint `json:"endpoints, omitempty"` }
DataResponse represents the data section of an osb-NetworkProfile in a response
type Endpoint ¶
Endpoint represents a network endpoint
func (*Endpoint) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON to an Endpoint
type EndpointMapping ¶
EndpointMapping represents an endpoint mapping used for an adapt_credentials call according to osb-spec
type HTTPError ¶
type HTTPError struct { ErrorMsg string `json:"error"` Description string `json:"description"` StatusCode int `json:"-"` }
HTTPError represents an error in the HTTP protocol
func HTTPErrorFromError ¶
HTTPErrorFromError converts an error to an error of type HTTPError
type NetworkDataRequest ¶
type NetworkDataRequest struct { NetworkProfileID string `json:"network_profile_id"` Data DataRequest `json:"data"` }
NetworkDataRequest represents a osb-NetworkProfile field in a request
type NetworkDataResponse ¶
type NetworkDataResponse struct { NetworkProfileID string `json:"network_profile_id"` Data DataResponse `json:"data"` }
NetworkDataResponse represents a osb-NetworkProfile field in a response
type NetworkProfile ¶
type NetworkProfile struct { ID string `json:"id"` Data json.RawMessage `json:"data"` }
NetworkProfile represents the network profile in provision or bind calls according to OSB-spec
type Plan ¶
type Plan struct { MetaData map[string]json.RawMessage `json:"metadata"` AdditionalProperties additionalProperties }
Plan represents a service plan
func (*Plan) MarshalJSON ¶
MarshalJSON from a service plan
func (*Plan) UnmarshalJSON ¶
UnmarshalJSON unmarshals to a service plan
type PostgresCredentials ¶
type PostgresCredentials struct { Credentials Hostname string Port int URI string WriteURL string ReadURL string }
PostgresCredentials contains credentials for a postgres
func PostgresCredentialsFromCredentials ¶
func PostgresCredentialsFromCredentials(credentials Credentials) (*PostgresCredentials, error)
PostgresCredentialsFromCredentials convert Credentials to PostgresCredentials
func (PostgresCredentials) ToCredentials ¶
func (credentials PostgresCredentials) ToCredentials() Credentials
ToCredentials converts to general Credentials
type ProvisionRequest ¶
type ProvisionRequest struct { AdditionalProperties additionalProperties NetworkProfiles []NetworkProfile }
ProvisionRequest represents a provision request according to OSB-spec
func (ProvisionRequest) MarshalJSON ¶
func (provisionRequest ProvisionRequest) MarshalJSON() ([]byte, error)
MarshalJSON from ProvisionRequest
func (*ProvisionRequest) UnmarshalJSON ¶
func (provisionRequest *ProvisionRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON to ProvisionRequest
type ProvisionResponse ¶
type ProvisionResponse struct { AdditionalProperties additionalProperties NetworkProfiles []NetworkProfile }
ProvisionResponse represents a provision request according to OSB-spec
func (ProvisionResponse) MarshalJSON ¶
func (provisionResponse ProvisionResponse) MarshalJSON() ([]byte, error)
MarshalJSON from ProvisionResponse
func (*ProvisionResponse) UnmarshalJSON ¶
func (provisionResponse *ProvisionResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON to ProvisionResponse
type RabbitMQCredentials ¶
type RabbitMQCredentials struct { Credentials Hostname string Port int URI string }
RabbitMQCredentials contains credentials for a rabbitmq
type Service ¶
Service represents a named service with plans
func (*Service) UnmarshalJSON ¶
UnmarshalJSON unmarshals