awsclienthandler

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SourceS3Client      *s3.Client
	DestinationS3Client *s3.Client
	FileStoreS3Client   *s3.Client
	PresignClient       *s3.PresignClient
)
View Source
var (
	KMSClient *kms.Client
)
View Source
var (
	SQSClient *sqs.Client
)

Functions

func ApplyTagToObject

func ApplyTagToObject(ctx context.Context, bucketName, objectKey, tagKey, tagValue string) error

ApplyTagToObject applies a single tag to an object in an S3 bucket

func DrainSQSQueue added in v0.8.0

func DrainSQSQueue(ctx context.Context, sqsClient *sqs.Client, queueURL, bucket, prefix string) (bool, error)

DrainSQSQueue long-polls SQS (up to 20s per receive) and deletes only messages whose S3 event matches the given bucket and prefix. Unrelated messages are left in the queue for other consumers. Returns true if any matching messages were found.

func GetBucketEncryptionKeyARN

func GetBucketEncryptionKeyARN(ctx context.Context, bucketName string) (string, error)

func GetDestinationS3Client added in v0.2.0

func GetDestinationS3Client() (*s3.Client, error)

GetDestinationS3Client returns the initialized Amazon S3 client instance.

func GetFileStoreS3Client added in v0.2.0

func GetFileStoreS3Client() (*s3.Client, error)

func GetKMSClient

func GetKMSClient() (*kms.Client, error)

func GetObject

func GetObject(ctx context.Context, s3Client *s3.Client, bucketName, objectKey string) (*s3.GetObjectOutput, error)

func GetPresignClient

func GetPresignClient() (*s3.PresignClient, error)

GetPresignClient returns the initialized Amazon S3 presign client instance.

func GetPresignedURL

func GetPresignedURL(ctx context.Context, s3Client *s3.Client, bucketName, objectKey string) (string, error)

func GetSQSClient

func GetSQSClient() (*sqs.Client, error)

GetSQSClient returns the initialized Amazon SQS client instance.

func GetSourceS3Client added in v0.2.0

func GetSourceS3Client() (*s3.Client, error)

GetSourceS3Client returns the initialized Amazon S3 client instance.

func ListObjectsInPrefix

func ListObjectsInPrefix(
	ctx context.Context, s3Client *s3.Client, bucketName, prefix string,
) ([]s3types.Object, error)

func NewDestinationS3ClientFromConfig added in v0.2.0

func NewDestinationS3ClientFromConfig(ctx context.Context, awsConfig *AWSConfig) error

NewDestinationS3ClientFromConfig creates Amazon S3 client destination S3

func NewFileStoreS3ClientFromConfig added in v0.2.0

func NewFileStoreS3ClientFromConfig(ctx context.Context, awsConfig *AWSConfig) error

func NewKMSClientFromConfig

func NewKMSClientFromConfig(ctx context.Context, awsConfig *AWSConfig) (*kms.Client, error)

func NewPresignClient

func NewPresignClient(ctx context.Context) (*s3.PresignClient, error)

NewPresignClient creates and returns an Amazon S3 presign client using the provided context and AWS configuration.

func NewS3Client added in v0.8.0

func NewS3Client(ctx context.Context, awsConfig *AWSConfig) (*s3.Client, error)

NewS3Client creates an S3 client from AWS credentials.

func NewSQSClientFromConfig

func NewSQSClientFromConfig(ctx context.Context, awsConfig *AWSConfig) (*sqs.Client, error)

NewSQSClientFromConfig creates and returns an Amazon SQS client using the provided context and AWS configuration.

func NewSourceS3ClientFromConfig added in v0.2.0

func NewSourceS3ClientFromConfig(ctx context.Context, awsConfig *AWSConfig) error

NewSourceS3ClientFromConfig creates Amazon S3 client for source S3

func ObjectExists

func ObjectExists(ctx context.Context, s3Client *s3.Client, bucketName, objectKey string) (bool, error)

Types

type AWSConfig

type AWSConfig struct {
	Region          string `json:"region"`
	AccessKeyID     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
	SessionToken    string `json:"sessionToken"`
	Endpoint        string `json:"endpoint"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL