s3-get

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 13 Imported by: 0

README

s3-get

Simple utility to download S3 Object with standard AWS Credentials resolution.

Installation:

$ go install github.com/stupoid/s3-get

Usage:

$ ./s3-get -h
Usage of ./s3-get:
  -concurrency int
    	The number of goroutines to spin up in parallel when sending parts.
    	If this is set to zero, the DefaultDownloadConcurrency value will be used.

    	Concurrency of 1 will download the parts sequentially.

    	Concurrency is ignored if the Range input parameter is provided.
  -dst string
    	Destination output path.
  -endpoint string
    	AWS endpoint to use (for connecting to S3 compatible interfaces).
    	Alternatively this can be set via environment variable 'S3_GET_ENDPOINT'.

    	If this is not set, the default AWS service endpoint will be used.

    	The value set by this flag will take precedence over the environment variable.
  -part-size int
    	The size (in bytes) to request from S3 for each part.
    	The minimum allowed part size is 5MB, and  if this value is set to zero,
    	the DefaultDownloadPartSize value will be used.

    	PartSize is ignored if the Range input parameter is provided.
  -quiet
    	Silence error output. (default true)
  -src string
    	Source S3 URI.
  -timeout duration
    	Download timeout.
    	If this is set to zero, no timeout will be set.

    	A duration string is a possibly signed sequence of decimal numbers,
    	each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m".
    	Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Example usage

Typical usage with AWS creds already loaded

$ ./s3-get -src=s3://my-bucket/credentials/private.crt -dst=./cert.pem

Usage with local mock S3 server

# start up a local mock s3 server (e.g. localstack)
$ docker --rm -d run -p 4566:4566 localstack/localstack -e SERVICES s3
$ ./s3-get -src=s3://my-bucket/credentials/private.crt -dst=./cert.pem -endpoint=http://127.0.0.1:4566

Alternate way to set custom aws endpoint

$ S3_GET_ENDPOINT=http://127.0.0.1:4566 ./s3-get -src=s3://my-bucket/credentials/private.crt -dst=./cert.pem

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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