From a92faa99348b2befe7a50572925340f72688a2b1 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 31 Dec 2025 21:56:05 +0100 Subject: [PATCH] docs: add CLAUDE.md for Claude Code integration --- .gitignore | 1 + CLAUDE.md | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 CLAUDE.md diff --git a/.gitignore b/.gitignore index 0163820..86a69fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +.claude coverage.* diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a5b8a66 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,41 @@ +# storage + +Shared Go library for AWS S3 storage operations. + +## Shared Documentation + +@../docs/claude/architecture.md +@../docs/claude/go-services.md +@../docs/claude/conventions.md + +## Library Information + +### Purpose + +Provides standardized S3 object storage utilities with presigned URL generation. Used by services that need to store and serve files (PDFs, images, etc.). + +### Usage + +```go +import "gitlab.com/unboundsoftware/shiny/storage" + +// Create storage with automatic AWS config +s3Storage, err := storage.New("my-bucket") + +// Upload and get presigned URL (15-minute expiration) +url, err := s3Storage.Store("path/to/file.pdf", reader, "application/pdf") +``` + +### Features + +- **Managed uploads** - For large files with multipart upload +- **Direct uploads** - For smaller files or custom config +- **Presigned URLs** - 15-minute expiration for secure access +- **Configurable part size** - For multipart upload optimization + +### Configuration + +Uses AWS SDK v2, loading config from: +- Environment variables (`AWS_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) +- Shared config files (`~/.aws/config`, `~/.aws/credentials`) +- IAM roles (on AWS infrastructure)