modulepackage
0.2.1
Repository: https://github.com/aaronland/go-cloud-s3blob.git
Documentation: pkg.go.dev
# README
go-cloud-s3blob
This is thing wrapper around the default go-cloud
S3 blob opener to check for a credentials
parameter (in blob URIs) and use it to assign AWS S3 session credentials.
Example
import (
"context"
"gocloud.dev/blob"
_ "github.com/aaronland/go-cloud-s3blob"
)
func main() {
ctx := context.Background()
bucket, _ := blob.OpenBucket(ctx, "s3blob://BUCKET?region=REGION&credentials=CREDENTIALS")
// do stuff with bucket here
}
Note the use of the s3blob://
scheme which is different than the default s3://
scheme.
Credentials
Credentials for AWS sessions are defined as string labels. They are:
Label | Description |
---|---|
env: | Read credentials from AWS defined environment variables. |
iam: | Assume AWS IAM credentials are in effect. |
{AWS_PROFILE_NAME} | This this profile from the default AWS credentials location. |
{AWS_CREDENTIALS_PATH}:{AWS_PROFILE_NAME} | This this profile from a user-defined AWS credentials location. |
See also
# Functions
SetACLWriterOptionsWithContext return a new context.Context instance with a gocloud.dev/blob.WriterOptions instance used to assign 'acl' permissions for all S3 blob writes.
# Constants
No description provided by the author