releaser ce2cdbe520
Release / release (push) Successful in 47s
storage / test (push) Successful in 1m36s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 6m5s
chore(release): prepare for v0.4.1 (#115)
## [0.4.1] - 2026-05-09

### 🐛 Bug Fixes

- *(deps)* Update aws-sdk-go-v2 monorepo (#102)
- *(deps)* Update aws-sdk-go-v2 monorepo (#103)
- *(deps)* Update aws-sdk-go-v2 monorepo (#104)
- *(deps)* Update aws-sdk-go-v2 monorepo (#105)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.20 (#108)

### 🎨 Styling

- Apply gofumpt formatting to s3.go (#112)

### ⚙️ Miscellaneous Tasks

- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.25.0 (#106)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.0 (#110)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.1 (#111)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.2 (#114)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #115
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-05-09 14:24:16 +00:00

Storage Module

Shared storage utilities for AWS S3.

Features

  • S3 object storage with presigned URL generation
  • Two upload strategies: managed uploads (for large files) and direct uploads
  • Configurable part size for multipart uploads
  • 15-minute presigned URL expiration

Usage

import "gitea.unbound.se/unboundsoftware/storage"

// Create storage with automatic AWS config loading
s3Storage, err := storage.New("my-bucket")
if err != nil {
    // handle error
}

// Upload a file and get a presigned URL
url, err := s3Storage.Store("path/to/file.pdf", fileReader, "application/pdf")

Using Direct Upload (for smaller files or custom config)

import (
    "github.com/aws/aws-sdk-go-v2/config"
    "git.unbound.se/unboundsoftware/storage"
)

// Load custom AWS config
cfg, err := config.LoadDefaultConfig(context.Background())
if err != nil {
    // handle error
}

// Create storage with custom config
s3Storage := storage.NewS3(cfg, "my-bucket")

// Upload a file and get a presigned URL
url, err := s3Storage.Store("path/to/file.pdf", fileReader, "application/pdf")

Configuration

The storage module uses AWS SDK v2 and loads configuration from:

  • Environment variables (AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  • Shared configuration files (~/.aws/config, ~/.aws/credentials)
  • IAM roles (when running on AWS infrastructure)
S
Description
No description provided
Readme 462 KiB
v0.4.2 Latest
2026-06-11 06:18:45 +00:00
Languages
Go 99.6%
JavaScript 0.4%