broker

package
v0.0.0-...-b80afe7 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package broker provides the core open service broker server functionality.

Index

Constants

This section is empty.

Variables

View Source
var ErrInternalError = errors.New("internal error")

ErrInternalError is returned when something really bad happened.

View Source
var ErrRequestMalformed = errors.New("request malformed")

ErrRequestMalformed is returned when the request is not as we expect.

View Source
var ErrRequestUnsupported = errors.New("request unsupported")

ErrRequestUnsupported is raised when something about the request is not supported.

View Source
var ErrServiceUnready = errors.New("service not ready")

ErrServiceUnready is raised when the service is not ready to run.

View Source
var ErrUnauthorized = errors.New("request is unauthorized")

ErrUnauthorized is raised when a user is not permitted to perform the request.

View Source
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.

Jump to

Keyboard shortcuts

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