Documentation ¶
Index ¶
- func ConvertCatalog(cat *pkgbrokerapi.Catalog) []pivbrokerapi.Service
- func NewCreateFunc(srv *httptest.Server, user, pass string) brokerapi.CreateFunc
- func Run(hdl *Handler, username, password string) *httptest.Server
- type BindRequest
- type DeprovisionRequest
- type Handler
- func (h *Handler) Bind(context context.Context, instanceID, bindingID string, ...) (brokerapi.Binding, error)
- func (h *Handler) Deprovision(context context.Context, instanceID string, ...) (brokerapi.DeprovisionServiceSpec, error)
- func (h *Handler) LastOperation(context context.Context, instanceID, operationData string) (brokerapi.LastOperation, error)
- func (h *Handler) Provision(ctx context.Context, instanceID string, details brokerapi.ProvisionDetails, ...) (brokerapi.ProvisionedServiceSpec, error)
- func (h *Handler) Services(ctx context.Context) []brokerapi.Service
- func (h *Handler) Unbind(context context.Context, instanceID, bindingID string, ...) error
- func (h *Handler) Update(context context.Context, instanceID string, details brokerapi.UpdateDetails, ...) (brokerapi.UpdateServiceSpec, error)
- type LastOperationRequest
- type ProvisionRequest
- type UnbindRequest
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCatalog ¶
func ConvertCatalog(cat *pkgbrokerapi.Catalog) []pivbrokerapi.Service
ConvertCatalog converts a (github.com/kubernetes-incubator/service-catalog/pkg/brokerapi).Catalog to an array of brokerapi.Services
func NewCreateFunc ¶
func NewCreateFunc(srv *httptest.Server, user, pass string) brokerapi.CreateFunc
NewCreateFunc creates a new brokerapi.CreateFunc according to a broker server running in srv
Types ¶
type BindRequest ¶
type BindRequest struct { InstanceID string BindingID string Details brokerapi.BindDetails }
BindRequest is the struct to contain details of a bind request
type DeprovisionRequest ¶
type DeprovisionRequest struct { InstanceID string Details brokerapi.DeprovisionDetails }
DeprovisionRequest is the struct to contain details of a single deprovision request
type Handler ¶
type Handler struct { Catalog []brokerapi.Service // Since there are no data passed to catalog calls, this is just the number of calls // that were made to the catalog endpoint CatalogRequests int ProvisionResp brokerapi.ProvisionedServiceSpec ProvisionRespError error ProvisionRequests []ProvisionRequest DeprovisionResp brokerapi.DeprovisionServiceSpec DeprovisonRespErr error DeprovisionRequests []DeprovisionRequest BindResp brokerapi.Binding BindRespErr error BindRequests []BindRequest UnbindRespErr error UnbindRequests []UnbindRequest UpdateResp brokerapi.UpdateServiceSpec UpdateRespErr error UpdateRequests []UpdateRequest LastOperationResp brokerapi.LastOperation LastOperationRespErr error LastOperationRequests []LastOperationRequest }
Handler is a fake implementation oif a brokerapi.ServiceBroker. It's useful as a mock because it has pre-canned response values for use in testing, and also keeps track of calls made to it. Handler is not concurrency-safe
func (*Handler) Bind ¶
func (h *Handler) Bind(context context.Context, instanceID, bindingID string, details brokerapi.BindDetails) (brokerapi.Binding, error)
Bind adds an element to h.BindRequqests and returns h.BindResp, h.BindRespErr
func (*Handler) Deprovision ¶
func (h *Handler) Deprovision(context context.Context, instanceID string, details brokerapi.DeprovisionDetails, asyncAllowed bool) (brokerapi.DeprovisionServiceSpec, error)
Deprovision adds an element to h.DeprovisionRequests and returns h.DeprovisionResp, h.DeprovisionRespErr
func (*Handler) LastOperation ¶
func (h *Handler) LastOperation(context context.Context, instanceID, operationData string) (brokerapi.LastOperation, error)
LastOperation adds an element to h.LastOperationRequests and returns h.LastOperationResp, h.LastOperationRespErr
func (*Handler) Provision ¶
func (h *Handler) Provision( ctx context.Context, instanceID string, details brokerapi.ProvisionDetails, asyncAllowed bool, ) (brokerapi.ProvisionedServiceSpec, error)
Provision adds an element to h.ProvisionRequests and returns h.ProvisionResp, h.ProvisionRespError
type LastOperationRequest ¶
LastOperationRequest is the struct that contains details of a single request to get the last operation of an ongoing broker action
type ProvisionRequest ¶
type ProvisionRequest struct { InstanceID string Details brokerapi.ProvisionDetails AsyncAllowed bool }
ProvisionRequest is the struct to house details of a single provision request
type UnbindRequest ¶
type UnbindRequest struct { InstanceID string BindingID string Details brokerapi.UnbindDetails }
UnbindRequest is the struct to house details of a single unbind request
type UpdateRequest ¶
type UpdateRequest struct { InstanceID string Details brokerapi.UpdateDetails AsyncAllowed bool }
UpdateRequest is the struct that contains details of a single update request