Documentation ¶
Index ¶
- func AppGUIDRequiredError() error
- func AsyncRequiredError() error
- func ConcurrencyError() error
- func NewFakeClientFunc(config FakeClientConfiguration) v2.CreateFunc
- func RequiredFieldsMissingError() error
- func ReturnFakeClientFunc(c *FakeClient) v2.CreateFunc
- func UnexpectedActionError() error
- type Action
- type ActionType
- type BindReaction
- type BindReactionInterface
- type CatalogReaction
- type CatalogReactionInterface
- type DeprovisionReaction
- type DeprovisionReactionInterface
- type DynamicBindReaction
- type DynamicCatalogReaction
- type DynamicDeprovisionReaction
- type DynamicGetBindingReaction
- type DynamicGetInstanceReaction
- type DynamicPollBindingLastOperationReaction
- type DynamicPollLastOperationReaction
- type DynamicProvisionReaction
- type DynamicUnbindReaction
- type DynamicUpdateInstanceReaction
- type FakeClient
- func (c *FakeClient) Actions() []Action
- func (c *FakeClient) Bind(r *v2.BindRequest) (*v2.BindResponse, error)
- func (c *FakeClient) DeprovisionInstance(r *v2.DeprovisionRequest) (*v2.DeprovisionResponse, error)
- func (c *FakeClient) GetBinding(*v2.GetBindingRequest) (*v2.GetBindingResponse, error)
- func (c *FakeClient) GetCatalog() (*v2.CatalogResponse, error)
- func (c *FakeClient) GetInstance(*v2.GetInstanceRequest) (*v2.GetInstanceResponse, error)
- func (c *FakeClient) PollBindingLastOperation(r *v2.BindingLastOperationRequest) (*v2.LastOperationResponse, error)
- func (c *FakeClient) PollLastOperation(r *v2.LastOperationRequest) (*v2.LastOperationResponse, error)
- func (c *FakeClient) ProvisionInstance(r *v2.ProvisionRequest) (*v2.ProvisionResponse, error)
- func (c *FakeClient) Unbind(r *v2.UnbindRequest) (*v2.UnbindResponse, error)
- func (c *FakeClient) UpdateInstance(r *v2.UpdateInstanceRequest) (*v2.UpdateInstanceResponse, error)
- type FakeClientConfiguration
- type GetBindingReaction
- type GetBindingReactionInterface
- type GetInstanceReaction
- type GetInstanceReactionInterface
- type PollBindingLastOperationReaction
- type PollBindingLastOperationReactionInterface
- type PollLastOperationReaction
- type PollLastOperationReactionInterface
- type ProvisionReaction
- type ProvisionReactionInterface
- type UnbindReaction
- type UnbindReactionInterface
- type UpdateInstanceReaction
- type UpdateInstanceReactionInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppGUIDRequiredError ¶
func AppGUIDRequiredError() error
AppGUIDRequiredError returns error for when app GUID is missing from bind request.
func AsyncRequiredError ¶
func AsyncRequiredError() error
AsyncRequiredError returns error for required asynchronous operations.
func ConcurrencyError ¶
func ConcurrencyError() error
ConcurrencyError returns error for when concurrent requests to modify the same resource is rejected.
func NewFakeClientFunc ¶
func NewFakeClientFunc(config FakeClientConfiguration) v2.CreateFunc
NewFakeClientFunc returns a v2.CreateFunc that returns a FakeClient with the given FakeClientConfiguration. It is useful for injecting the FakeClient in code that uses the v2.CreateFunc interface.
func RequiredFieldsMissingError ¶
func RequiredFieldsMissingError() error
RequiredFieldsMissingError returns an error message indicating that a required field was not set
func ReturnFakeClientFunc ¶
func ReturnFakeClientFunc(c *FakeClient) v2.CreateFunc
ReturnFakeClientFunc returns a v2.CreateFunc that returns the given FakeClient.
func UnexpectedActionError ¶
func UnexpectedActionError() error
UnexpectedActionError returns an error message when an action is not found in the FakeClient's action array.
Types ¶
type Action ¶
type Action struct { Type ActionType Request interface{} }
Action is a record of a method call on the FakeClient.
type ActionType ¶
type ActionType string
ActionType is a typedef over the set of actions that can be taken on a FakeClient.
const ( GetCatalog ActionType = "GetCatalog" ProvisionInstance ActionType = "ProvisionInstance" UpdateInstance ActionType = "UpdateInstance" DeprovisionInstance ActionType = "DeprovisionInstance" GetInstance ActionType = "GetInstance" PollLastOperation ActionType = "PollLastOperation" PollBindingLastOperation ActionType = "PollBindingLastOperation" Bind ActionType = "Bind" Unbind ActionType = "Unbind" GetBinding ActionType = "GetBinding" )
These are the set of actions that can be taken on a FakeClient.
type BindReaction ¶
type BindReaction struct { Response *v2.BindResponse Error error }
type BindReactionInterface ¶
type BindReactionInterface interface {
// contains filtered or unexported methods
}
BindReactionInterface defines the reaction to Bind requests.
type CatalogReaction ¶
type CatalogReaction struct { Response *v2.CatalogResponse Error error }
type CatalogReactionInterface ¶
type CatalogReactionInterface interface {
// contains filtered or unexported methods
}
CatalogReactionInterface defines the reaction to GetCatalog requests.
type DeprovisionReaction ¶
type DeprovisionReaction struct { Response *v2.DeprovisionResponse Error error }
type DeprovisionReactionInterface ¶
type DeprovisionReactionInterface interface {
// contains filtered or unexported methods
}
DeprovisionReactionInterface defines the reaction to DeprovisionInstance requests.
type DynamicBindReaction ¶
type DynamicBindReaction func(*v2.BindRequest) (*v2.BindResponse, error)
type DynamicCatalogReaction ¶
type DynamicCatalogReaction func() (*v2.CatalogResponse, error)
type DynamicDeprovisionReaction ¶
type DynamicDeprovisionReaction func(*v2.DeprovisionRequest) (*v2.DeprovisionResponse, error)
type DynamicGetBindingReaction ¶
type DynamicGetBindingReaction func() (*v2.GetBindingResponse, error)
type DynamicGetInstanceReaction ¶
type DynamicGetInstanceReaction func() (*v2.GetInstanceResponse, error)
type DynamicPollBindingLastOperationReaction ¶
type DynamicPollBindingLastOperationReaction func(*v2.BindingLastOperationRequest) (*v2.LastOperationResponse, error)
type DynamicPollLastOperationReaction ¶
type DynamicPollLastOperationReaction func(*v2.LastOperationRequest) (*v2.LastOperationResponse, error)
type DynamicProvisionReaction ¶
type DynamicProvisionReaction func(*v2.ProvisionRequest) (*v2.ProvisionResponse, error)
type DynamicUnbindReaction ¶
type DynamicUnbindReaction func(*v2.UnbindRequest) (*v2.UnbindResponse, error)
type DynamicUpdateInstanceReaction ¶
type DynamicUpdateInstanceReaction func(*v2.UpdateInstanceRequest) (*v2.UpdateInstanceResponse, error)
type FakeClient ¶
type FakeClient struct { CatalogReaction CatalogReactionInterface ProvisionReaction ProvisionReactionInterface UpdateInstanceReaction UpdateInstanceReactionInterface DeprovisionReaction DeprovisionReactionInterface GetInstanceReaction GetInstanceReactionInterface PollLastOperationReaction PollLastOperationReactionInterface PollLastOperationReactions map[v2.OperationKey]*PollLastOperationReaction PollBindingLastOperationReaction PollBindingLastOperationReactionInterface BindReaction BindReactionInterface UnbindReaction UnbindReactionInterface GetBindingReaction GetBindingReactionInterface sync.Mutex // contains filtered or unexported fields }
FakeClient is a fake implementation of the v2.Client interface. It records the actions that are taken on it and runs the appropriate reaction to those actions. If an action for which there is no reaction specified occurs, it returns an error. FakeClient is threadsafe.
func NewFakeClient ¶
func NewFakeClient(config FakeClientConfiguration) *FakeClient
NewFakeClient returns a new fake Client with the given FakeClientConfiguration.
func (*FakeClient) Actions ¶
func (c *FakeClient) Actions() []Action
Actions is a method defined on FakeClient that returns the actions taken on it.
func (*FakeClient) Bind ¶
func (c *FakeClient) Bind(r *v2.BindRequest) (*v2.BindResponse, error)
Bind implements the Client.Bind method on the FakeClient.
func (*FakeClient) DeprovisionInstance ¶
func (c *FakeClient) DeprovisionInstance(r *v2.DeprovisionRequest) (*v2.DeprovisionResponse, error)
DeprovisionInstance implements the Client.DeprovisionInstance method on the FakeClient.
func (*FakeClient) GetBinding ¶
func (c *FakeClient) GetBinding(*v2.GetBindingRequest) (*v2.GetBindingResponse, error)
GetBinding implements the Client.GetBinding method for the FakeClient.
func (*FakeClient) GetCatalog ¶
func (c *FakeClient) GetCatalog() (*v2.CatalogResponse, error)
GetCatalog implements the Client.GetCatalog method for the FakeClient.
func (*FakeClient) GetInstance ¶
func (c *FakeClient) GetInstance(*v2.GetInstanceRequest) (*v2.GetInstanceResponse, error)
GetInstance implements the Client.GetInstance method for the FakeClient.
func (*FakeClient) PollBindingLastOperation ¶
func (c *FakeClient) PollBindingLastOperation(r *v2.BindingLastOperationRequest) (*v2.LastOperationResponse, error)
PollBindingLastOperation implements the Client.PollBindingLastOperation method on the FakeClient.
func (*FakeClient) PollLastOperation ¶
func (c *FakeClient) PollLastOperation(r *v2.LastOperationRequest) (*v2.LastOperationResponse, error)
PollLastOperation implements the Client.PollLastOperation method on the FakeClient.
func (*FakeClient) ProvisionInstance ¶
func (c *FakeClient) ProvisionInstance(r *v2.ProvisionRequest) (*v2.ProvisionResponse, error)
ProvisionInstance implements the Client.ProvisionRequest method for the FakeClient.
func (*FakeClient) Unbind ¶
func (c *FakeClient) Unbind(r *v2.UnbindRequest) (*v2.UnbindResponse, error)
Unbind implements the Client.Unbind method on the FakeClient.
func (*FakeClient) UpdateInstance ¶
func (c *FakeClient) UpdateInstance(r *v2.UpdateInstanceRequest) (*v2.UpdateInstanceResponse, error)
UpdateInstance implements the Client.UpdateInstance method for the FakeClient.
type FakeClientConfiguration ¶
type FakeClientConfiguration struct { CatalogReaction CatalogReactionInterface ProvisionReaction ProvisionReactionInterface UpdateInstanceReaction UpdateInstanceReactionInterface DeprovisionReaction DeprovisionReactionInterface GetInstanceReaction GetInstanceReactionInterface PollLastOperationReaction PollLastOperationReactionInterface PollLastOperationReactions map[v2.OperationKey]*PollLastOperationReaction PollBindingLastOperationReaction PollBindingLastOperationReactionInterface BindReaction BindReactionInterface UnbindReaction UnbindReactionInterface GetBindingReaction GetBindingReactionInterface }
FakeClientConfiguration models the configuration of a FakeClient.
type GetBindingReaction ¶
type GetBindingReaction struct { Response *v2.GetBindingResponse Error error }
type GetBindingReactionInterface ¶
type GetBindingReactionInterface interface {
// contains filtered or unexported methods
}
GetBindingReactionInterface defines the reaction to GetBinding requests.
type GetInstanceReaction ¶
type GetInstanceReaction struct { Response *v2.GetInstanceResponse Error error }
type GetInstanceReactionInterface ¶
type GetInstanceReactionInterface interface {
// contains filtered or unexported methods
}
GetInstanceReactionInterface defines the reaction to GetInstance requests.
type PollBindingLastOperationReaction ¶
type PollBindingLastOperationReaction struct { Response *v2.LastOperationResponse Error error }
type PollBindingLastOperationReactionInterface ¶
type PollBindingLastOperationReactionInterface interface {
// contains filtered or unexported methods
}
PollBindingLastOperationReactionInterface defines the reaction to PollLastOperation requests.
type PollLastOperationReaction ¶
type PollLastOperationReaction struct { Response *v2.LastOperationResponse Error error }
type PollLastOperationReactionInterface ¶
type PollLastOperationReactionInterface interface {
// contains filtered or unexported methods
}
PollLastOperationReactionInterface defines the reaction to PollLastOperation requests.
type ProvisionReaction ¶
type ProvisionReaction struct { Response *v2.ProvisionResponse Error error }
type ProvisionReactionInterface ¶
type ProvisionReactionInterface interface {
// contains filtered or unexported methods
}
ProvisionReactionInterface defines the reaction to ProvisionInstance requests.
type UnbindReaction ¶
type UnbindReaction struct { Response *v2.UnbindResponse Error error }
type UnbindReactionInterface ¶
type UnbindReactionInterface interface {
// contains filtered or unexported methods
}
UnbindReactionInterface defines the reaction to Unbind requests.
type UpdateInstanceReaction ¶
type UpdateInstanceReaction struct { Response *v2.UpdateInstanceResponse Error error }
type UpdateInstanceReactionInterface ¶
type UpdateInstanceReactionInterface interface {
// contains filtered or unexported methods
}
UpdateInstanceReactionInterface defines the reaction to UpdateInstance requests.