Documentation ¶
Overview ¶
Package mock encapsulates mocks for testing GCE provider functionality. These methods are used to override the mock objects' methods in order to intercept the standard processing and to add custom logic for test purposes.
// Example usage:
cloud := cloud.NewMockGCE() cloud.MockTargetPools.AddInstanceHook = mock.AddInstanceHook
Index ¶
- func AddInstanceHook(ctx context.Context, key *meta.Key, req *ga.TargetPoolsAddInstanceRequest, ...) error
- func InsertAddressHook(ctx context.Context, key *meta.Key, obj *ga.Address, m *cloud.MockAddresses) (bool, error)
- func InsertAlphaAddressHook(ctx context.Context, key *meta.Key, obj *alpha.Address, ...) (bool, error)
- func InsertAlphaFwdRuleHook(ctx context.Context, key *meta.Key, obj *alpha.ForwardingRule, ...) (bool, error)
- func InsertBetaAddressHook(ctx context.Context, key *meta.Key, obj *beta.Address, m *cloud.MockAddresses) (bool, error)
- func InsertBetaFwdRuleHook(ctx context.Context, key *meta.Key, obj *beta.ForwardingRule, ...) (bool, error)
- func InsertFwdRuleHook(ctx context.Context, key *meta.Key, obj *ga.ForwardingRule, ...) (bool, error)
- func RemoveInstanceHook(ctx context.Context, key *meta.Key, req *ga.TargetPoolsRemoveInstanceRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddInstanceHook ¶
func AddInstanceHook(ctx context.Context, key *meta.Key, req *ga.TargetPoolsAddInstanceRequest, m *cloud.MockTargetPools) error
AddInstanceHook mocks adding a Instance to MockTargetPools
func InsertAddressHook ¶
func InsertAddressHook(ctx context.Context, key *meta.Key, obj *ga.Address, m *cloud.MockAddresses) (bool, error)
InsertAddressHook mocks inserting an Address.
func InsertAlphaAddressHook ¶
func InsertAlphaAddressHook(ctx context.Context, key *meta.Key, obj *alpha.Address, m *cloud.MockAlphaAddresses) (bool, error)
InsertAlphaAddressHook mocks inserting an Address. Addresses are expected to default to Premium tier if no NetworkTier is specified.
func InsertAlphaFwdRuleHook ¶
func InsertAlphaFwdRuleHook(ctx context.Context, key *meta.Key, obj *alpha.ForwardingRule, m *cloud.MockForwardingRules) (bool, error)
InsertAlphaFwdRuleHook mocks inserting an AlphaForwardingRule.
func InsertBetaAddressHook ¶
func InsertBetaAddressHook(ctx context.Context, key *meta.Key, obj *beta.Address, m *cloud.MockAddresses) (bool, error)
InsertBetaAddressHook mocks inserting a BetaAddress.
func InsertBetaFwdRuleHook ¶
func InsertBetaFwdRuleHook(ctx context.Context, key *meta.Key, obj *beta.ForwardingRule, m *cloud.MockForwardingRules) (bool, error)
InsertBetaFwdRuleHook mocks inserting a BetaForwardingRule.
func InsertFwdRuleHook ¶
func InsertFwdRuleHook(ctx context.Context, key *meta.Key, obj *ga.ForwardingRule, m *cloud.MockForwardingRules) (bool, error)
InsertFwdRuleHook mocks inserting a ForwardingRule. ForwardingRules are expected to default to Premium tier if no NetworkTier is specified.
func RemoveInstanceHook ¶
func RemoveInstanceHook(ctx context.Context, key *meta.Key, req *ga.TargetPoolsRemoveInstanceRequest, m *cloud.MockTargetPools) error
RemoveInstanceHook mocks removing a Instance from MockTargetPools
Types ¶
This section is empty.