s3

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package s3 implements the storage contract with AWS S3 (or a compatible API such as LocalStack/MinIO).

Index

Constants

This section is empty.

Variables

Module provides the S3 backend as the storage contract. Requires an s3.Config in the graph, supplied by the service.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bucket       string `mapstructure:"bucket"`
	AwsRegion    string `mapstructure:"aws_region"`
	Key          string `mapstructure:"key"`
	Secret       string `mapstructure:"secret"`
	Endpoint     string `mapstructure:"endpoint"`
	UsePathStyle bool   `mapstructure:"use_path_style"`
	BaseURL      string `mapstructure:"base_url"`
}

Config holds S3 connection settings. Services embed it in their config structs; the mapstructure tags live here so every service shares the same config schema.

type S3

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

S3 is a per-region storage backend backed by AWS S3 (or a compatible API).

func New

func New(sc Config) (*S3, error)

New creates an S3 backend. Uses static credentials if Key/Secret are set; otherwise falls back to the default AWS credential chain.

func (*S3) Delete

func (s *S3) Delete(ctx context.Context, path string) error

Delete removes an object from the bucket.

func (*S3) DownloadURL

func (s *S3) DownloadURL(ctx context.Context, path string, expiry time.Duration) (string, error)

DownloadURL returns a presigned GET URL for direct client download from S3.

func (*S3) Move

func (s *S3) Move(ctx context.Context, src, dst string) error

Move relocates an object within the bucket via server-side copy + delete.

func (*S3) UploadURL

func (s *S3) UploadURL(ctx context.Context, path string, expiry time.Duration) (string, error)

UploadURL returns a presigned PUT URL for direct client upload to S3.

Jump to

Keyboard shortcuts

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