Documentation ¶
Index ¶
- Constants
- type BasicAuthTransport
- type Broker
- type Brokers
- type Client
- type ServiceManagerClient
- func (c *ServiceManagerClient) GetBrokers(ctx context.Context) ([]Broker, error)
- func (c *ServiceManagerClient) GetPlans(ctx context.Context) ([]*types.ServicePlan, error)
- func (c *ServiceManagerClient) GetPlansByServiceOfferings(ctx context.Context, sos []*types.ServiceOffering) ([]*types.ServicePlan, error)
- func (c *ServiceManagerClient) GetServiceOfferingsByBrokerIDs(ctx context.Context, brokerIDs []string) ([]*types.ServiceOffering, error)
- func (c *ServiceManagerClient) GetVisibilities(ctx context.Context) ([]*types.Visibility, error)
- type Settings
- type SkipSSLTransport
Constants ¶
const ( // APIInternalBrokers is the SM API for obtaining the brokers for this proxy APIInternalBrokers = "%s" + web.ServiceBrokersURL // APIVisibilities is the SM API for obtaining plan visibilities APIVisibilities = "%s" + web.VisibilitiesURL // APIPlans is the SM API for obtaining service plans APIPlans = "%s" + web.ServicePlansURL // APIServiceOfferings is the SM API for obtaining service offerings APIServiceOfferings = "%s" + web.ServiceOfferingsURL )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuthTransport ¶
type BasicAuthTransport struct { Username string Password string Rt http.RoundTripper }
BasicAuthTransport implements http.RoundTripper interface and intercepts that request that is being sent, adding basic authorization and delegates back to the original transport.
type Broker ¶
type Broker struct { ID string `json:"id"` Name string `json:"name"` BrokerURL string `json:"broker_url"` ServiceOfferings []types.ServiceOffering `json:"services"` Metadata map[string]json.RawMessage `json:"metadata,omitempty"` }
Broker type used for responses from the Service Manager client
type Brokers ¶
type Brokers struct {
Brokers []Broker `json:"service_brokers"`
}
Brokers type used for responses from the Service Manager client
type Client ¶
type Client interface { GetBrokers(ctx context.Context) ([]Broker, error) GetVisibilities(ctx context.Context) ([]*types.Visibility, error) GetPlans(ctx context.Context) ([]*types.ServicePlan, error) GetServiceOfferingsByBrokerIDs(ctx context.Context, brokerIDs []string) ([]*types.ServiceOffering, error) GetPlansByServiceOfferings(ctx context.Context, sos []*types.ServiceOffering) ([]*types.ServicePlan, error) }
Client provides the logic for calling into the Service Manager
type ServiceManagerClient ¶ added in v0.1.1
type ServiceManagerClient struct {
// contains filtered or unexported fields
}
ServiceManagerClient allows consuming Service Manager APIs
func NewClient ¶
func NewClient(config *Settings) (*ServiceManagerClient, error)
NewClient builds a new Service Manager Client from the provided configuration
func (*ServiceManagerClient) GetBrokers ¶ added in v0.1.1
func (c *ServiceManagerClient) GetBrokers(ctx context.Context) ([]Broker, error)
GetBrokers calls the Service Manager in order to obtain all brokers that need to be registered in the service broker proxy
func (*ServiceManagerClient) GetPlans ¶ added in v0.2.0
func (c *ServiceManagerClient) GetPlans(ctx context.Context) ([]*types.ServicePlan, error)
GetPlans returns plans from Service Manager
func (*ServiceManagerClient) GetPlansByServiceOfferings ¶ added in v0.3.0
func (c *ServiceManagerClient) GetPlansByServiceOfferings(ctx context.Context, sos []*types.ServiceOffering) ([]*types.ServicePlan, error)
GetPlansByServiceOfferings returns plans from Service Manager
func (*ServiceManagerClient) GetServiceOfferingsByBrokerIDs ¶ added in v0.3.0
func (c *ServiceManagerClient) GetServiceOfferingsByBrokerIDs(ctx context.Context, brokerIDs []string) ([]*types.ServiceOffering, error)
GetServiceOfferingsByBrokerIDs returns plans from Service Manager
func (*ServiceManagerClient) GetVisibilities ¶ added in v0.2.0
func (c *ServiceManagerClient) GetVisibilities(ctx context.Context) ([]*types.Visibility, error)
GetVisibilities returns plan visibilities from Service Manager
type Settings ¶
type Settings struct { User string Password string URL string OSBAPIPath string `mapstructure:"osb_api_path"` RequestTimeout time.Duration `mapstructure:"request_timeout"` ResyncPeriod time.Duration `mapstructure:"resync_period"` SkipSSLValidation bool `mapstructure:"skip_ssl_validation"` Transport http.RoundTripper }
Settings type holds SM Client config properties
func DefaultSettings ¶
func DefaultSettings() *Settings
DefaultSettings builds a default Service Manager Settings
func NewSettings ¶
func NewSettings(env env.Environment) (*Settings, error)
NewSettings builds a Service Manager Settings from the provided Environment
type SkipSSLTransport ¶
type SkipSSLTransport struct { SkipSslValidation bool Rt http.RoundTripper }
SkipSSLTransport implements http.RoundTripper and sets the SSL Validation to match the provided property