Documentation ¶
Overview ¶
Package osbutil provides utilties for interacting with Open Service Brokers.
Index ¶
- func MapOSBToKfCatalog(catalog *osbclient.CatalogResponse) (out []v1alpha1.ServiceOffering)
- func NewBasicAuthSecret(name, username, password, url string, broker kmeta.OwnerRefable) *corev1.Secret
- func NewClient(secret *corev1.Secret) (osbclient.Client, error)
- func NewConfigFromSecret(secret *corev1.Secret) (*osbclient.ClientConfiguration, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapOSBToKfCatalog ¶
func MapOSBToKfCatalog(catalog *osbclient.CatalogResponse) (out []v1alpha1.ServiceOffering)
MapOSBToKfCatalog converts an OSB style catalog to Kf's version with deterministic ordering.
func NewBasicAuthSecret ¶
func NewBasicAuthSecret(name, username, password, url string, broker kmeta.OwnerRefable) *corev1.Secret
NewBasicAuthSecret creates a new secret for connecting to a service broker via HTTP Basic Authentication.
func NewClient ¶
NewClient creates a new OSB client from a secret.
Example ¶
// Assume the broker and secret already exist secret := createFakeBrokerSecret() // NewClient checks the structural validity of the secret, but doesn't attempt // to ping the broker on startup. client, err := NewClient(secret) if err != nil { // XXX: Handle the error correctly for your context. panic(err) } // XXX: Make a call to the broker here e.g. client.GetCatalog() fmt.Printf("Client initialized? %t\n", client != nil)
Output: Client initialized? true
Example (Error) ¶
_, err := NewClient(nil) fmt.Println(err.Error())
Output: nil Secret not allowed
func NewConfigFromSecret ¶
func NewConfigFromSecret(secret *corev1.Secret) (*osbclient.ClientConfiguration, error)
NewConfigFromSecret creates a new OSB connection configuration from a secret; in the process it validates the secret for structural correctness.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.