s3

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package s3 provides a persistence Driver backed by Amazon S3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AWS is the AWS configuration used to create the S3 client.
	AWS aws.Config

	// ClientOptions are additional options applied to the S3 client.
	ClientOptions []func(*awss3.Options)

	// Bucket is the S3 bucket name.
	Bucket string
}

Config holds the configuration for an S3 persistence driver.

func FromURL

func FromURL(ctx context.Context, u *url.URL) (*Config, error)

FromURL returns a *Config for the given s3:// *url.URL. See ParseURL for the URL format.

func ParseURL

func ParseURL(ctx context.Context, u string) (*Config, error)

ParseURL returns a *Config for the given s3:// URL string.

URL format:

s3:///<bucket>
s3://<endpoint>/<bucket>

Supported query parameters:

  • region: AWS region (e.g. "us-east-1"); if omitted, resolved from the environment
  • role_arn: ARN of an IAM role to assume via STS
  • insecure: use HTTP instead of HTTPS for a custom endpoint (requires a host)

func (*Config) NewDriver

func (c *Config) NewDriver(context.Context) (*Driver, error)

NewDriver creates a Driver using the configured AWS settings.

type Driver

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

Driver is a persistence driver backed by Amazon S3.

func New

func New(client *awss3.Client, bucket string) *Driver

New returns a Driver that uses the given S3 client and bucket.

func (*Driver) Close

func (d *Driver) Close() error

Close is a no-op. The S3 client does not require explicit cleanup.

func (*Driver) JournalStore

func (d *Driver) JournalStore() journal.BinaryStore

JournalStore returns a journal store backed by S3.

func (*Driver) KVStore

func (d *Driver) KVStore() kv.BinaryStore

KVStore returns a key/value store backed by S3.

func (*Driver) SetStore

func (d *Driver) SetStore() set.BinaryStore

SetStore returns a set store backed by S3.

Directories

Path Synopsis
Package s3journal provides an implementation of journal.BinaryStore that persists to an S3 bucket.
Package s3journal provides an implementation of journal.BinaryStore that persists to an S3 bucket.
Package s3kv provides a kv.BinaryStore implementation that persists to an S3 bucket.
Package s3kv provides a kv.BinaryStore implementation that persists to an S3 bucket.
Package s3set provides a set.BinaryStore implementation that persists to an S3 bucket.
Package s3set provides a set.BinaryStore implementation that persists to an S3 bucket.

Jump to

Keyboard shortcuts

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