fileutils

package
v0.0.0-...-5c2f431 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEntryToTar

func AddEntryToTar(source *os.File, entryName string, entryContents string) error

func DownloadS3File

func DownloadS3File(ctx context.Context, s3Downloader S3Downloader, launchRoleArn string, s3Path string) (*os.File, error)

func UnzipFile

func UnzipFile(compressed *os.File) (*os.File, error)

UnzipFile decompresses the file that is passed and returns an open file containing the newly decompressed source.

It closes the file that was passed to it after it has been fully read.

func ZipFile

func ZipFile(uncompressed *os.File) (*os.File, error)

Types

type S3ClientProvider

type S3ClientProvider func(launchRoleArn string) (*s3.Client, error)

type S3Downloader

type S3Downloader interface {
	Download(ctx context.Context, launchRoleArn string, tmp *os.File, bucket string, key string) (n int64, err error)
}

type S3ManagerDownloader

type S3ManagerDownloader struct {
	S3ClientProvider S3ClientProvider
}

func NewS3DownloaderWithAssumedRole

func NewS3DownloaderWithAssumedRole(ctx context.Context, sdkConfig aws.Config) S3ManagerDownloader

NewS3DownloaderWithAssumedRole creates a new S3 Downloader that will assume the provided launch role to make requests to fetch files from S3

func (S3ManagerDownloader) Download

func (downloader S3ManagerDownloader) Download(ctx context.Context, launchRoleArn string, tmp *os.File, bucket string, objectKey string) (n int64, err error)

Jump to

Keyboard shortcuts

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