mirror of
https://github.com/fleetdm/fleet
synced 2026-05-18 14:38:53 +00:00
#29482 [Migrate to the AWS SDK for Go v2](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/migrate-gosdk.html) documents how to migrate codebases. QA on features that use AWS SDK Go: - Bootstrap package: - upload: ✅ - download: ✅ - cleanup: ✅ - Software (upload, download, installation, etc.) ✅ - Cloudfront: Luckly, this feature was already using aws-sdk-go-v2. - Carves ✅ - Logging: - Firehose ✅ - Kinesis ✅ - Lambda ✅ (tested result logs to a lambda function on our AWS Dogfood account) - Email: - Amazon SES TODO ⚠️ (this is what Dogfood uses and a few customers) - We cannot easily test locally, we can use dogfood or load testing (AWS) environments. --- - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [ ] Manual QA for all new/changed functionality
29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/aws/aws-sdk-go-v2/service/firehose"
|
|
)
|
|
|
|
type (
|
|
PutRecordBatchFunc func(context.Context, *firehose.PutRecordBatchInput, ...func(*firehose.Options)) (*firehose.PutRecordBatchOutput, error)
|
|
DescribeDeliveryStreamFunc func(context.Context, *firehose.DescribeDeliveryStreamInput, ...func(*firehose.Options)) (*firehose.DescribeDeliveryStreamOutput, error)
|
|
|
|
FirehoseMock struct {
|
|
PutRecordBatchFunc PutRecordBatchFunc
|
|
PutRecordBatchFuncInvoked bool
|
|
DescribeDeliveryStreamFunc DescribeDeliveryStreamFunc
|
|
DescribeDeliveryStreamFuncInvoked bool
|
|
}
|
|
)
|
|
|
|
func (f *FirehoseMock) PutRecordBatch(ctx context.Context, input *firehose.PutRecordBatchInput, optFns ...func(*firehose.Options)) (*firehose.PutRecordBatchOutput, error) {
|
|
f.PutRecordBatchFuncInvoked = true
|
|
return f.PutRecordBatchFunc(ctx, input, optFns...)
|
|
}
|
|
|
|
func (f *FirehoseMock) DescribeDeliveryStream(ctx context.Context, input *firehose.DescribeDeliveryStreamInput, optFns ...func(*firehose.Options)) (*firehose.DescribeDeliveryStreamOutput, error) {
|
|
f.DescribeDeliveryStreamFuncInvoked = true
|
|
return f.DescribeDeliveryStreamFunc(ctx, input, optFns...)
|
|
}
|