renovate 1efbed6f17
renovate/stability-days Updates have met minimum release age requirement
storage / test (pull_request) Successful in 1m39s
storage / vulnerabilities (pull_request) Successful in 1m43s
pre-commit / pre-commit (pull_request) Successful in 6m20s
fix(deps): update aws-sdk-go-v2 monorepo
2026-04-05 19:18:35 +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 377 KiB
v0.1.4 Latest
2026-04-02 09:17:12 +00:00
Languages
Go 99.6%
JavaScript 0.4%