Skip to content

Commit

Permalink
awsOptsFn
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jul 11, 2024
1 parent 60851fe commit a53a2b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kafkalib/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c Connection) Mechanism() Mechanism {
return Plain
}

func (c Connection) Dialer(ctx context.Context) (*kafka.Dialer, error) {
func (c Connection) Dialer(ctx context.Context, awsOptFns ...func(options *awsCfg.LoadOptions) error) (*kafka.Dialer, error) {
dialer := &kafka.Dialer{
Timeout: 10 * time.Second,
DualStack: true,
Expand All @@ -66,7 +66,7 @@ func (c Connection) Dialer(ctx context.Context) (*kafka.Dialer, error) {
dialer.TLS = &tls.Config{}
}
case AwsMskIam:
_awsCfg, err := awsCfg.LoadDefaultConfig(ctx)
_awsCfg, err := awsCfg.LoadDefaultConfig(ctx, awsOptFns...)
if err != nil {
return nil, fmt.Errorf("failed to load aws configuration: %w", err)
}
Expand Down

0 comments on commit a53a2b6

Please sign in to comment.