Closed SeenYang closed 2 years ago
@SeenYang which version are you getting the error with? master?
The 0.3.5
cut is not designed to use the AWS SDK v2
v2 sdk doesn't support kinesisiface.KinesisAPI so I created a local interface:
// kinesisClient defines the interface of functions needed for the consumer
type kinesisClient interface {
GetRecords(ctx context.Context, params *kinesis.GetRecordsInput, optFns ...func(*kinesis.Options)) (*kinesis.GetRecordsOutput, error)
ListShards(ctx context.Context, params *kinesis.ListShardsInput, optFns ...func(*kinesis.Options)) (*kinesis.ListShardsOutput, error)
GetShardIterator(ctx context.Context, params *kinesis.GetShardIteratorInput, optFns ...func(*kinesis.Options)) (*kinesis.GetShardIteratorOutput, error)
}
which the v2 client implements
I get a similar error using the examples consumer code. For some reason, it still tries to match with kinesisiface.KinesisAPI unsuccessfully.
I came here to say this and ask about a fix.
./kin.go:60:22: cannot use client (type "github.com/aws/aws-sdk-go-v2/service/kinesis".Client) as type kinesisiface.KinesisAPI in argument to consumer.WithClient: "github.com/aws/aws-sdk-go-v2/service/kinesis".Client does not implement kinesisiface.KinesisAPI (wrong type for AddTagsToStream method) have AddTagsToStream(context.Context, "github.com/aws/aws-sdk-go-v2/service/kinesis".AddTagsToStreamInput, ...func("github.com/aws/aws-sdk-go-v2/service/kinesis".Options)) ("github.com/aws/aws-sdk-go-v2/service/kinesis".AddTagsToStreamOutput, error) want AddTagsToStream("github.com/aws/aws-sdk-go/service/kinesis".AddTagsToStreamInput) (*"github.com/aws/aws-sdk-go/service/kinesis".AddTagsToStreamOutput, error)
OK - I believe I've figured this out. Mixing Kinesis-client that needs v2 apis with a system built with v1 apis. Clearly I need to update my SDK version.
I came here to say this and ask about a fix.
command-line-arguments
./kin.go:60:22: cannot use client (type "github.com/aws/aws-sdk-go-v2/service/kinesis".Client) as type kinesisiface.KinesisAPI in argument to consumer.WithClient: "github.com/aws/aws-sdk-go-v2/service/kinesis".Client does not implement kinesisiface.KinesisAPI (wrong type for AddTagsToStream method) have AddTagsToStream(context.Context, "github.com/aws/aws-sdk-go-v2/service/kinesis".AddTagsToStreamInput, ...func("github.com/aws/aws-sdk-go-v2/service/kinesis".Options)) ("github.com/aws/aws-sdk-go-v2/service/kinesis".AddTagsToStreamOutput, error) want AddTagsToStream("github.com/aws/aws-sdk-go/service/kinesis".AddTagsToStreamInput) (*"github.com/aws/aws-sdk-go/service/kinesis".AddTagsToStreamOutput, error)
OK - I believe I've figured this out. Mixing Kinesis-client that needs v2 apis with a system built with v1 apis. Clearly I need to update my SDK version.
I came here to say this and ask about a fix.
command-line-arguments
./kin.go:60:22: cannot use client (type "github.com/aws/aws-sdk-go-v2/service/kinesis".Client) as type kinesisiface.KinesisAPI in argument to consumer.WithClient: "github.com/aws/aws-sdk-go-v2/service/kinesis".Client does not implement kinesisiface.KinesisAPI (wrong type for AddTagsToStream method) have AddTagsToStream(context.Context, "github.com/aws/aws-sdk-go-v2/service/kinesis".AddTagsToStreamInput, ...func("github.com/aws/aws-sdk-go-v2/service/kinesis".Options)) ("github.com/aws/aws-sdk-go-v2/service/kinesis".AddTagsToStreamOutput, error) want AddTagsToStream("github.com/aws/aws-sdk-go/service/kinesis".AddTagsToStreamInput) (*"github.com/aws/aws-sdk-go/service/kinesis".AddTagsToStreamOutput, error)
Hi Yes. Sorry for late reply. I figured out the same case and might need to make sure they are using the same.
As discussed, I recon rodmcelrath making the point thus I will close the comment. Please reopen or link to new issue if further issue found.
Hi, For release 0.3.5, The method signiture is:
Current master version is:
it's throwing our exception if we want to use latest![image](https://user-images.githubusercontent.com/15993720/143972190-29e04570-98e1-4cd4-b8a7-c68a59d4aa00.png)
aws-sdk-go-v2
Cheers Y