model

package
v0.0.0-...-2972591 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPErrorFromResponse

func HTTPErrorFromResponse(statusCode int, body []byte, url string, method string, contentType string) error

HTTPErrorFromResponse returns an HTTPError if the provided request was unsuccessful

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

type Endpoint struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

Endpoint represents a network endpoint

func (*Endpoint) UnmarshalJSON

func (ep *Endpoint) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals JSON to an Endpoint

type EndpointMapping

type EndpointMapping struct {
	Source Endpoint
	Target Endpoint
}

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

func HTTPErrorFromError(err error, statusCode int) *HTTPError

HTTPErrorFromError converts an error to an error of type HTTPError

func (HTTPError) Error

func (e HTTPError) Error() string

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

func (p *Plan) MarshalJSON() ([]byte, error)

MarshalJSON from a service plan

func (*Plan) UnmarshalJSON

func (p *Plan) UnmarshalJSON(b []byte) error

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

type Service struct {
	Name                 string
	Plans                []Plan
	AdditionalProperties additionalProperties
}

Service represents a named service with plans

func (Service) MarshalJSON

func (s Service) MarshalJSON() ([]byte, error)

MarshalJSON marshals

func (*Service) UnmarshalJSON

func (s *Service) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals

Jump to

Keyboard shortcuts

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