api

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OperationProvisioning represents the "provisioning" operation
	OperationProvisioning = "provisioning"
	// OperationUpdating represents the "updating" operation
	OperationUpdating = "updating"
	// OperationDeprovisioning represents the "deprovisioning" operation
	OperationDeprovisioning = "deprovisioning"
	// OperationStateDeferred represents the state of an operation that has been
	// requested, but has been deferred pending completion of some other action
	OperationStateDeferred = "deferred"
	// OperationStateInProgress represents the state of an operation that is still
	// pending completion
	OperationStateInProgress = "in progress"
	// OperationStateSucceeded represents the state of an operation that has
	// completed successfully
	OperationStateSucceeded = "succeeded"
	// OperationStateFailed represents the state of an operation that has
	// failed
	OperationStateFailed = "failed"
	// OperationStateGone is a pseudo oepration state represting the "state"
	// of an operation against an entity that no longer exists
	OperationStateGone = "gone"
)

Variables

This section is empty.

Functions

func GetBindingResponseFromJSON

func GetBindingResponseFromJSON(
	jsonBytes []byte,
	bindingResponse *BindingResponse,
) error

GetBindingResponseFromJSON returns a new BindingResponse unmarshalled from the provided JSON []byte

Types

type BasicAuthConfig added in v0.10.0

type BasicAuthConfig interface {
	GetUsername() string
	GetPassword() string
}

BasicAuthConfig represents details such as username and password that will be used to secure the broker using basic auth

func GetBasicAuthConfig added in v0.10.0

func GetBasicAuthConfig() (BasicAuthConfig, error)

GetBasicAuthConfig returns basic auth configuration

type BindingRequest

type BindingRequest struct {
	ServiceID  string                 `json:"service_id"`
	PlanID     string                 `json:"plan_id"`
	Parameters map[string]interface{} `json:"parameters"`
}

BindingRequest represents a request to bind to a service

func NewBindingRequestFromJSON added in v0.10.0

func NewBindingRequestFromJSON(
	jsonBytes []byte,
) (*BindingRequest, error)

NewBindingRequestFromJSON returns a new BindingRequest unmarshaled from the provided JSON []byte

func (*BindingRequest) ToJSON

func (b *BindingRequest) ToJSON() ([]byte, error)

ToJSON returns a []byte containing a JSON representation of the binding request

type BindingResponse

type BindingResponse struct {
	Credentials service.Credentials `json:"credentials"`
}

BindingResponse represents the response to a binding request

func (*BindingResponse) ToJSON

func (b *BindingResponse) ToJSON() ([]byte, error)

ToJSON returns a []byte containing a JSON representation of the binding response

type Config added in v1.1.0

type Config struct {
	Port        int    `envconfig:"PORT"`
	TLSCertPath string `envconfig:"TLS_CERT_PATH"`
	TLSKeyPath  string `envconfig:"TLS_KEY_PATH"`
}

Config represents configuration options for the API server

func GetConfigFromEnvironment added in v1.1.0

func GetConfigFromEnvironment() (Config, error)

GetConfigFromEnvironment returns configuration derived from environment variables

func NewConfigWithDefaults added in v1.1.0

func NewConfigWithDefaults() Config

NewConfigWithDefaults returns a Config object with default values already applied. Callers are then free to set custom values for the remaining fields and/or override default values.

type ProvisioningRequest

type ProvisioningRequest struct {
	ServiceID  string                 `json:"service_id"`
	PlanID     string                 `json:"plan_id"`
	Parameters map[string]interface{} `json:"parameters"`
}

ProvisioningRequest represents a request to provision a service

func NewProvisioningRequestFromJSON added in v0.10.0

func NewProvisioningRequestFromJSON(
	jsonBytes []byte,
) (*ProvisioningRequest, error)

NewProvisioningRequestFromJSON returns a new ProvisioningRequest unmarshaled from the provided JSON []byte

func (*ProvisioningRequest) ToJSON

func (p *ProvisioningRequest) ToJSON() ([]byte, error)

ToJSON returns a []byte containing a JSON representation of the provisioning request

type Server

type Server interface {
	// Run causes the api server to start serving HTTP requests. It will block
	// until an error occurs and will return that error.
	Run(context.Context) error
}

Server is an interface for components that respond to HTTP requests on behalf of the broker

func NewServer

func NewServer(
	apiServerConfig Config,
	store storage.Store,
	asyncEngine async.Engine,
	filterChain filter.Filter,
	catalog service.Catalog,
) (Server, error)

NewServer returns an HTTP router

type UpdatingPreviousValues

type UpdatingPreviousValues struct {
	PlanID string `json:"plan_id"`
}

UpdatingPreviousValues represents the information about the service instance prior to the update. Our broker doesn't need it. Per spec, it still could be provided.

type UpdatingRequest

type UpdatingRequest struct {
	ServiceID      string                 `json:"service_id"`
	PlanID         string                 `json:"plan_id"`
	Parameters     map[string]interface{} `json:"parameters"`
	PreviousValues UpdatingPreviousValues `json:"previous_values"`
}

UpdatingRequest represents a request to update a service

func NewUpdatingRequestFromJSON added in v0.10.0

func NewUpdatingRequestFromJSON(
	jsonBytes []byte,
) (*UpdatingRequest, error)

NewUpdatingRequestFromJSON returns a new UpdatingRequest unmarshaled from the provided JSON []byte

func (*UpdatingRequest) ToJSON

func (u *UpdatingRequest) ToJSON() ([]byte, error)

ToJSON returns a []byte containing a JSON representation of the updating request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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