Files
cybertron/internal/client/aws/aws.go
Varnit Goyal 9b4768c0e6 Tp 55555/integrate document service client (#7)
* TP-55555 | document client and kafka integration

* TP-55555 | introduce service concept refactor code

* TP-55555 | s3 and kafka producer integrated and tested

* TP-55555 | s3 and kafka producer integrated and tested

* TP-55555 | fixed kafka for subsequent request

* TP-55555 | fixed kafka for subsequent request
2024-07-29 15:46:17 +05:30

27 lines
547 B
Go

package aws
import (
"context"
"cybertron/configs"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
"log"
)
type Actions struct {
S3Client *s3.Client
S3PresignClient *s3.PresignClient
}
func NewS3client(clientConfig configs.AwsConfig) *Actions {
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion(clientConfig.Region))
if err != nil {
log.Fatal(err)
}
svc := s3.NewFromConfig(cfg)
return &Actions{
S3Client: svc,
S3PresignClient: s3.NewPresignClient(svc),
}
}