mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 00:18:27 +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
28 lines
1 KiB
Go
28 lines
1 KiB
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/aws/aws-sdk-go-v2/service/kinesis"
|
|
)
|
|
|
|
type (
|
|
PutRecordsFunc func(context.Context, *kinesis.PutRecordsInput, ...func(*kinesis.Options)) (*kinesis.PutRecordsOutput, error)
|
|
DescribeStreamFunc func(context.Context, *kinesis.DescribeStreamInput, ...func(*kinesis.Options)) (*kinesis.DescribeStreamOutput, error)
|
|
KinesisMock struct {
|
|
PutRecordsFunc PutRecordsFunc
|
|
PutRecordsFuncInvoked bool
|
|
DescribeStreamFunc DescribeStreamFunc
|
|
DescribeStreamFuncInvoked bool
|
|
}
|
|
)
|
|
|
|
func (k *KinesisMock) PutRecords(ctx context.Context, input *kinesis.PutRecordsInput, optFns ...func(*kinesis.Options)) (*kinesis.PutRecordsOutput, error) {
|
|
k.PutRecordsFuncInvoked = true
|
|
return k.PutRecordsFunc(ctx, input, optFns...)
|
|
}
|
|
|
|
func (k *KinesisMock) DescribeStream(ctx context.Context, input *kinesis.DescribeStreamInput, optFns ...func(*kinesis.Options)) (*kinesis.DescribeStreamOutput, error) {
|
|
k.DescribeStreamFuncInvoked = true
|
|
return k.DescribeStreamFunc(ctx, input, optFns...)
|
|
}
|