s3

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	Endpoint        string // For S3-compatible services
	UsePathStyle    bool   // For S3-compatible services
	DisableSSL      bool
	Profile         string // AWS profile name
}

Config holds S3 connection configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default S3 configuration

type S3Downloader

type S3Downloader struct {
	// contains filtered or unexported fields
}

S3Downloader handles AWS S3 protocol downloads

func NewS3Downloader

func NewS3Downloader(cfg *Config) (*S3Downloader, error)

NewS3Downloader creates a new S3 downloader instance

func (*S3Downloader) Close

func (s *S3Downloader) Close() error

Close closes the S3 downloader (no-op for S3 client)

func (*S3Downloader) Download

func (s *S3Downloader) Download(ctx context.Context, url string, writer io.Writer) error

Download downloads an object from S3 and writes it to the provided writer

func (*S3Downloader) DownloadRange

func (s *S3Downloader) DownloadRange(ctx context.Context, url string, writer io.Writer, start, end int64) error

DownloadRange downloads a specific range of bytes from an S3 object

func (*S3Downloader) GetObjectMetadata

func (s *S3Downloader) GetObjectMetadata(ctx context.Context, url string) (map[string]interface{}, error)

GetObjectMetadata returns metadata for an S3 object

func (*S3Downloader) GetObjectSize

func (s *S3Downloader) GetObjectSize(ctx context.Context, url string) (int64, error)

GetObjectSize returns the size of an S3 object

func (*S3Downloader) ListObjects

func (s *S3Downloader) ListObjects(ctx context.Context, bucket, prefix string, maxKeys int32) ([]string, error)

ListObjects lists objects in an S3 bucket with optional prefix

func (*S3Downloader) ObjectExists

func (s *S3Downloader) ObjectExists(ctx context.Context, url string) (bool, error)

ObjectExists checks if an object exists in S3

Jump to

Keyboard shortcuts

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