This is a partial implementation of a service broker conforming to the Open Service Broker API. It is intended to save time creating new service brokers by implementing the parts which are generic to all brokers of this kind. It can be used in two ways:
- Imported as a library
- Copying the code
This code is used as a starting point. Your own code will involve two responsibilities:
- Implementing a 'provider', which interacts with an API to manage your service.
- Managing its own configuration and service catalog.
In order to complete your own service broker you need to implement the provider
interface. These methods cover each of the lifecycle management operations for a service instance.
You must provide a JSON file such as the example configuration. You can see in the configuration tests which fields are mandatory and which have defaults you can use. The catalog
field must exist and contain a list of services as defined in the catalog management section of the Open Service Broker API specification.
The broker
package provides a NewConfig
method for parsing the configuration file. This config is passed in when creating a new broker with the New
method. The configuration type contains a Provider
field which contains the raw configuration file as a slice of bytes. Your broker implementation is responsible for knowing how to unmarshal this data.
A full example usage can be found in the aws-service-broker repository.
Tests for this repository are run with:
ginkgo -r
They are mostly unit tests. Integration with the upstream brokerapi
library are covered by the API tests.
Once you have a working broker you can use the helper methods in the broker/testing
package to test it as a broker client would.