Documentation ¶
Index ¶
- Constants
- func GetS3ClientFromRegion(ctx context.Context, region string) (*s3.Client, error)
- func NewRequest(ctx context.Context, logger *zap.Logger, req *http.Request, ...) (*http.Request, error)
- func RefreshCredentialsPeriodically(ctx context.Context, logger *zap.Logger)
- func RefreshS3ClientPeriodically(ctx context.Context, logger *zap.Logger)
- func WithPath(path string) func(*Options)
- type Options
- type SourceBucket
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 GetS3ClientFromRegion ¶ added in v1.1.0
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 RefreshS3ClientPeriodically ¶ added in v1.1.0
Types ¶
type SourceBucket ¶
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.
Click to show internal directories.
Click to hide internal directories.