remove calls to deprecated functions.
Signed-off-by: Fabiano Graças <fabiano.gracas@faro.com>
This commit is contained in:
parent
725fef3ab1
commit
10787dedaf
3 changed files with 8 additions and 8 deletions
|
|
@ -90,7 +90,7 @@ func (checkpointer *DynamoCheckpoint) Init() error {
|
|||
checkpointer.log.Infof("Creating DynamoDB session")
|
||||
|
||||
if checkpointer.svc == nil {
|
||||
er := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
|
||||
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||
if service == dynamodb.ServiceID && len(checkpointer.kclConfig.DynamoDBEndpoint) > 0 {
|
||||
return aws.Endpoint{
|
||||
PartitionID: "aws",
|
||||
|
|
@ -106,7 +106,7 @@ func (checkpointer *DynamoCheckpoint) Init() error {
|
|||
context.TODO(),
|
||||
awsConfig.WithRegion(checkpointer.kclConfig.RegionName),
|
||||
awsConfig.WithCredentialsProvider(checkpointer.kclConfig.DynamoDBCredentials),
|
||||
awsConfig.WithEndpointResolver(er),
|
||||
awsConfig.WithEndpointResolverWithOptions(resolver),
|
||||
awsConfig.WithRetryer(func() aws.Retryer {
|
||||
return retry.AddWithMaxBackoffDelay(retry.NewStandard(), retry.DefaultMaxBackoff)
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ func (w *Worker) initialize() error {
|
|||
// create session for Kinesis
|
||||
log.Infof("Creating Kinesis client")
|
||||
|
||||
resolver := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
|
||||
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||
return aws.Endpoint{
|
||||
PartitionID: "aws",
|
||||
URL: w.kclConfig.KinesisEndpoint,
|
||||
|
|
@ -171,7 +171,7 @@ func (w *Worker) initialize() error {
|
|||
context.TODO(),
|
||||
awsConfig.WithRegion(w.regionName),
|
||||
awsConfig.WithCredentialsProvider(w.kclConfig.KinesisCredentials),
|
||||
awsConfig.WithEndpointResolver(resolver),
|
||||
awsConfig.WithEndpointResolverWithOptions(resolver),
|
||||
awsConfig.WithRetryer(func() aws.Retryer {
|
||||
return retry.AddWithMaxBackoffDelay(retry.NewStandard(), retry.DefaultMaxBackoff)
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ func NewKinesisClient(t *testing.T, regionName, endpoint string, creds aws.Crede
|
|||
// create session for Kinesis
|
||||
t.Logf("Creating Kinesis client")
|
||||
|
||||
resolver := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
|
||||
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||
return aws.Endpoint{
|
||||
PartitionID: "aws",
|
||||
URL: endpoint,
|
||||
|
|
@ -57,7 +57,7 @@ func NewKinesisClient(t *testing.T, regionName, endpoint string, creds aws.Crede
|
|||
context.TODO(),
|
||||
awsConfig.WithRegion(regionName),
|
||||
awsConfig.WithCredentialsProvider(creds),
|
||||
awsConfig.WithEndpointResolver(resolver),
|
||||
awsConfig.WithEndpointResolverWithOptions(resolver),
|
||||
awsConfig.WithRetryer(func() aws.Retryer {
|
||||
return retry.AddWithMaxBackoffDelay(retry.NewStandard(), retry.DefaultMaxBackoff)
|
||||
}),
|
||||
|
|
@ -73,7 +73,7 @@ func NewKinesisClient(t *testing.T, regionName, endpoint string, creds aws.Crede
|
|||
|
||||
// NewDynamoDBClient to create a Kinesis Client.
|
||||
func NewDynamoDBClient(t *testing.T, regionName, endpoint string, creds aws.CredentialsProvider) *dynamodb.Client {
|
||||
resolver := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
|
||||
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||
return aws.Endpoint{
|
||||
PartitionID: "aws",
|
||||
URL: endpoint,
|
||||
|
|
@ -85,7 +85,7 @@ func NewDynamoDBClient(t *testing.T, regionName, endpoint string, creds aws.Cred
|
|||
context.TODO(),
|
||||
awsConfig.WithRegion(regionName),
|
||||
awsConfig.WithCredentialsProvider(creds),
|
||||
awsConfig.WithEndpointResolver(resolver),
|
||||
awsConfig.WithEndpointResolverWithOptions(resolver),
|
||||
awsConfig.WithRetryer(func() aws.Retryer {
|
||||
return retry.AddWithMaxBackoffDelay(retry.NewStandard(), retry.DefaultMaxBackoff)
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in a new issue