From a53a2b6a1c15d977bb08ba5a2745695f615c1b73 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Thu, 11 Jul 2024 13:01:26 -0700 Subject: [PATCH] awsOptsFn --- lib/kafkalib/connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kafkalib/connection.go b/lib/kafkalib/connection.go index d02880fda..1cc8498b9 100644 --- a/lib/kafkalib/connection.go +++ b/lib/kafkalib/connection.go @@ -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, @@ -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) }