Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing part of cloudwatch client for blog post
package aws
import (
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/cloudwatchlogsiface"
)
// CloudWatchLogsClientMock is a mock for cloudwatch logs client
type CloudWatchLogsClientMock struct {
cloudwatchlogsiface.CloudWatchLogsAPI
Psfr func(input *cloudwatchlogs.PutSubscriptionFilterInput) cloudwatchlogs.PutSubscriptionFilterRequest
Dlgr func(input *cloudwatchlogs.DescribeLogGroupsInput) cloudwatchlogs.DescribeLogGroupsRequest
Dsfr func(input *cloudwatchlogs.DescribeSubscriptionFiltersInput) cloudwatchlogs.DescribeSubscriptionFiltersRequest
Delsfr func(input *cloudwatchlogs.DeleteSubscriptionFilterInput) cloudwatchlogs.DeleteSubscriptionFilterRequest
}
// PutSubscriptionFilterRequest mocks cloudwatch logs client method
func (c CloudWatchLogsClientMock) PutSubscriptionFilterRequest(input *cloudwatchlogs.PutSubscriptionFilterInput) cloudwatchlogs.PutSubscriptionFilterRequest {
return c.Psfr(input)
}
// DescribeLogGroupsRequest mocks cloudwatch logs client method
func (c CloudWatchLogsClientMock) DescribeLogGroupsRequest(input *cloudwatchlogs.DescribeLogGroupsInput) cloudwatchlogs.DescribeLogGroupsRequest {
return c.Dlgr(input)
}
// DescribeSubscriptionFiltersRequest mocks cloudwatch logs client method
func (c CloudWatchLogsClientMock) DescribeSubscriptionFiltersRequest(input *cloudwatchlogs.DescribeSubscriptionFiltersInput) cloudwatchlogs.DescribeSubscriptionFiltersRequest {
return c.Dsfr(input)
}
// DeleteSubscriptionFilterRequest mocks cloudwatch logs client method
func (c CloudWatchLogsClientMock) DeleteSubscriptionFilterRequest(input *cloudwatchlogs.DeleteSubscriptionFilterInput) cloudwatchlogs.DeleteSubscriptionFilterRequest {
return c.Delsfr(input)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment