aws

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// example: https://bucket-name.s3.region-code.amazonaws.com/key-name
	VirtualHostedStyle s3RequestStyle = "virtual-hosted-style"
	// example: https://s3.region-code.amazonaws.com/bucket-name/key-name
	PathStyle s3RequestStyle = "path-style"
)

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(ctx context.Context, logger *zap.Logger, req *http.Request, sourceBucket SourceBucket, opts ...func(*Options)) (*http.Request, error)

NewRequest creates a standard aws s3 request

func RefreshCredentialsPeriodically

func RefreshCredentialsPeriodically(ctx context.Context, logger *zap.Logger)

func WithPath added in v1.3.0

func WithPath(path string) func(*Options)

Types

type Options added in v1.3.0

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

type SourceBucket

type SourceBucket struct {
	Bucket string
	Region string
	Style  s3RequestStyle
}

func ExtractSourceBucket

func ExtractSourceBucket(req *http.Request) (SourceBucket, error)

extractSourceBucket extracts the aws request bucket using Path-style or Virtual-hosted-style requests. https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html This method will error if the bucket cannot be extracted from the request.

Jump to

Keyboard shortcuts

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