api

package
v0.0.0-...-62bfe6a Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 15 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 BasicAuth

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

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

type BasicAuthConfig

type BasicAuthConfig struct {
	Username   string
	CFUsername string
	Password   string
	CFPassword string
}

func (BasicAuthConfig) GetPassword

func (b BasicAuthConfig) GetPassword() string

func (BasicAuthConfig) GetUsername

func (b BasicAuthConfig) GetUsername() string

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

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

type Config struct {
	Port        int
	TLSCertPath string
	TLSKeyPath  string
}

Config represents configuration options for the API server

func NewConfigWithDefaults

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

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

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