Documentation ¶
Index ¶
- func GetFunctionConfiguration(stackname *string, constructID *string) (*types.FunctionConfiguration, error)
- func InvokeFunction(stackname *string, constructID *string, eventFile *string) (*string, error)
- func SetClient(c LambdaInterface)
- type LambdaInterface
- type LambdaInterfaceMock
- func (mock *LambdaInterfaceMock) GetFunction(ctx context.Context, params *lambda.GetFunctionInput, ...) (*lambda.GetFunctionOutput, error)
- func (mock *LambdaInterfaceMock) GetFunctionCalls() []struct{ ... }
- func (mock *LambdaInterfaceMock) Invoke(ctx context.Context, params *lambda.InvokeInput, ...) (*lambda.InvokeOutput, error)
- func (mock *LambdaInterfaceMock) InvokeCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunctionConfiguration ¶
func GetFunctionConfiguration(stackname *string, constructID *string) (*types.FunctionConfiguration, error)
func InvokeFunction ¶ added in v0.1.13
InvokeFunction stackName - name of an CDK deployed Cloudformation Stack constructID - name of the CDK Construct of the Lambda Resource eventFile - local json file, which will be synchronosly send to the Lambda function
func SetClient ¶
func SetClient(c LambdaInterface)
Types ¶
type LambdaInterface ¶
type LambdaInterface interface { GetFunction(ctx context.Context, params *lambda.GetFunctionInput, optFns ...func(*lambda.Options)) (*lambda.GetFunctionOutput, error) Invoke(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error) }
type LambdaInterfaceMock ¶ added in v0.1.13
type LambdaInterfaceMock struct { // GetFunctionFunc mocks the GetFunction method. GetFunctionFunc func(ctx context.Context, params *lambda.GetFunctionInput, optFns ...func(*lambda.Options)) (*lambda.GetFunctionOutput, error) // InvokeFunc mocks the Invoke method. InvokeFunc func(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error) // contains filtered or unexported fields }
LambdaInterfaceMock is a mock implementation of LambdaInterface.
func TestSomethingThatUsesLambdaInterface(t *testing.T) { // make and configure a mocked LambdaInterface mockedLambdaInterface := &LambdaInterfaceMock{ GetFunctionFunc: func(ctx context.Context, params *lambda.GetFunctionInput, optFns ...func(*lambda.Options)) (*lambda.GetFunctionOutput, error) { panic("mock out the GetFunction method") }, InvokeFunc: func(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error) { panic("mock out the Invoke method") }, } // use mockedLambdaInterface in code that requires LambdaInterface // and then make assertions. }
func (*LambdaInterfaceMock) GetFunction ¶ added in v0.1.13
func (mock *LambdaInterfaceMock) GetFunction(ctx context.Context, params *lambda.GetFunctionInput, optFns ...func(*lambda.Options)) (*lambda.GetFunctionOutput, error)
GetFunction calls GetFunctionFunc.
func (*LambdaInterfaceMock) GetFunctionCalls ¶ added in v0.1.13
func (mock *LambdaInterfaceMock) GetFunctionCalls() []struct { Ctx context.Context Params *lambda.GetFunctionInput OptFns []func(*lambda.Options) }
GetFunctionCalls gets all the calls that were made to GetFunction. Check the length with:
len(mockedLambdaInterface.GetFunctionCalls())
func (*LambdaInterfaceMock) Invoke ¶ added in v0.1.13
func (mock *LambdaInterfaceMock) Invoke(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error)
Invoke calls InvokeFunc.
func (*LambdaInterfaceMock) InvokeCalls ¶ added in v0.1.13
func (mock *LambdaInterfaceMock) InvokeCalls() []struct { Ctx context.Context Params *lambda.InvokeInput OptFns []func(*lambda.Options) }
InvokeCalls gets all the calls that were made to Invoke. Check the length with:
len(mockedLambdaInterface.InvokeCalls())
Click to show internal directories.
Click to hide internal directories.