Documentation
¶
Overview ¶
Package broker provides the core open service broker server functionality.
Index ¶
- Variables
- func ConfigureServer(clients client.Clients, configuration *ServerConfiguration) error
- func JSONResponse(w http.ResponseWriter, status int, data interface{})
- func NewOpenServiceBrokerHandler(configuration *ServerConfiguration) http.Handler
- func RunServer(configuration *ServerConfiguration) error
- type ServerConfiguration
- type ServerConfigurationBasicAuth
Constants ¶
This section is empty.
Variables ¶
var ErrInternalError = errors.New("internal error")
ErrInternalError is returned when something really bad happened.
var ErrRequestMalformed = errors.New("request malformed")
ErrRequestMalformed is returned when the request is not as we expect.
var ErrRequestUnsupported = errors.New("request unsupported")
ErrRequestUnsupported is raised when something about the request is not supported.
var ErrServiceUnready = errors.New("service not ready")
ErrServiceUnready is raised when the service is not ready to run.
ErrUnauthorized is raised when a user is not permitted to perform the request.
var ErrUnexpected = goerrors.New("unexpected error")
ErrUnexpected is highly unlikely to happen...
Functions ¶
func ConfigureServer ¶
func ConfigureServer(clients client.Clients, configuration *ServerConfiguration) error
ConfigureServer is the main entry point for both the container and test.
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, status int, data interface{})
JSONResponse sends generic JSON data back to the client and replies with a HTTP status code.
func NewOpenServiceBrokerHandler ¶
func NewOpenServiceBrokerHandler(configuration *ServerConfiguration) http.Handler
NewOpenServiceBrokerHandler initializes the main router with the Open Service Broker API.
func RunServer ¶
func RunServer(configuration *ServerConfiguration) error
Types ¶
type ServerConfiguration ¶
type ServerConfiguration struct {
// Namespace is the namespace the broker is running in.
Namespace string
// Token is set when using bearer token authentication.
Token *string
// BasicAuth is set when using basic authentication.
BasicAuth *ServerConfigurationBasicAuth
// Certificate is the TLS key/certificate to serve with.
Certificate tls.Certificate
}
ServerConfiguration is used to propagate server configuration to the server instance and its handlers.
type ServerConfigurationBasicAuth ¶
type ServerConfigurationBasicAuth struct {
// Username is the user API requests will require.
Username string
// Password is the password for the user.
Password string
}
ServerConfigurationBasicAuth defines basic authentication.