Skip to content

Commit 6112485

Browse files
committed
docs: improve README clarity and add project roadmap
"we never used to have like so many emojis earlier and the look of the readme on github was really professional. can you please fix that" "can you critique the readme" - Remove emojis from features list and code examples for professional appearance - Fix error handling in Quick Start example - Add proper error checks for io.ReadAll - Fix escaped newlines in printf statements (\\n to \n) - Remove confusing SetEndpoint line from Quick Start - Add ROADMAP.md with planned features through v1.0.0 - Update Contributing section to reference ROADMAP.md
1 parent 171b675 commit 6112485

2 files changed

Lines changed: 218 additions & 26 deletions

File tree

README.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ in S3 buckets using REST API calls or Presigned URLs signed
77
using AWS Signature Version 4.
88

99
**Features:**
10-
- 🚀 **Simple, intuitive API** following Go idioms
11-
- 🪣 **Complete S3 operations** - Upload, Download, Delete, List, Details
12-
- 🔐 **AWS Signature Version 4** signing
13-
- 🌐 **Custom endpoint support** (MinIO, DigitalOcean Spaces, etc.)
14-
- 📋 **Simple List API** with pagination, prefix filtering, and delimiter grouping
15-
- 🔄 **Iterator-based ListAll** for memory-efficient large bucket iteration (Go 1.23+)
16-
- 🔗 **Presigned URL generation** for secure browser uploads/downloads
17-
- 🪪 **IAM credential support** for EC2 instances
18-
- **Comprehensive test coverage**
19-
- 🎯 **Zero dependencies** - uses only Go standard library
10+
- **Simple, intuitive API** following Go idioms
11+
- **Complete S3 operations** - Upload, Download, Delete, List, Details
12+
- **AWS Signature Version 4** signing
13+
- **Custom endpoint support** (MinIO, DigitalOcean Spaces, etc.)
14+
- **Simple List API** with pagination, prefix filtering, and delimiter grouping
15+
- **Iterator-based ListAll** for memory-efficient large bucket iteration (Go 1.23+)
16+
- **Presigned URL generation** for secure browser uploads/downloads
17+
- **IAM credential support** for EC2 instances
18+
- **Comprehensive test coverage**
19+
- **Zero dependencies** - uses only Go standard library
2020

2121
## Install
2222

@@ -39,11 +39,11 @@ func main() {
3939
// Initialize S3 client
4040
s3 := simples3.New("us-east-1", "your-access-key", "your-secret-key")
4141

42-
// Use MinIO or other S3-compatible services
43-
s3.SetEndpoint("https://s3.amazonaws.com")
44-
4542
// Upload a file
46-
file, _ := os.Open("my-file.txt")
43+
file, err := os.Open("my-file.txt")
44+
if err != nil {
45+
log.Fatal(err)
46+
}
4747
defer file.Close()
4848

4949
resp, err := s3.FileUpload(simples3.UploadInput{
@@ -99,6 +99,9 @@ defer file.Close()
9999

100100
// Read the content
101101
data, err := io.ReadAll(file)
102+
if err != nil {
103+
log.Fatal(err)
104+
}
102105
```
103106

104107
#### Delete Files
@@ -159,12 +162,12 @@ if err != nil {
159162

160163
// Process objects
161164
for _, obj := range result.Objects {
162-
fmt.Printf("📄 %s (%d bytes)\n", obj.Key, obj.Size)
165+
fmt.Printf("%s (%d bytes)\n", obj.Key, obj.Size)
163166
}
164167

165168
// Process "directories" (common prefixes)
166169
for _, prefix := range result.CommonPrefixes {
167-
fmt.Printf("📁 %s/\n", prefix)
170+
fmt.Printf("%s/\n", prefix)
168171
}
169172
```
170173

@@ -180,7 +183,7 @@ seq, finish := s3.ListAll(simples3.ListInput{
180183
})
181184

182185
for obj := range seq {
183-
fmt.Printf("📄 %s (%d bytes)\n", obj.Key, obj.Size)
186+
fmt.Printf("%s (%d bytes)\n", obj.Key, obj.Size)
184187
}
185188

186189
// Check for any errors that occurred during iteration
@@ -231,9 +234,9 @@ func main() {
231234
log.Fatal(err)
232235
}
233236

234-
fmt.Printf("Total objects: %d\\n", len(allObjects))
237+
fmt.Printf("Total objects: %d\n", len(allObjects))
235238
for _, obj := range allObjects {
236-
fmt.Printf("- %s (%d bytes)\\n", obj.Key, obj.Size)
239+
fmt.Printf("- %s (%d bytes)\n", obj.Key, obj.Size)
237240
}
238241
}
239242
```
@@ -344,13 +347,7 @@ export AWS_S3_BUCKET="testbucket"
344347

345348
## Contributing
346349

347-
We welcome contributions! Please:
348-
349-
1. Fork the repository
350-
2. Create a feature branch
351-
3. Add tests for new functionality
352-
4. Ensure all tests pass: `just test-local`
353-
5. Submit a pull request
350+
Contributions welcome! Check [ROADMAP.md](ROADMAP.md) for planned features. Please add tests and ensure `just test-local` passes before submitting PRs.
354351

355352
## Author
356353

ROADMAP.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# Project Roadmap
2+
3+
## Current: v0.x (Pre-Stable)
4+
5+
### Completed Features
6+
- File Upload (PUT via FilePut, POST multipart via FileUpload)
7+
- File Download (GetObject)
8+
- File Delete (DeleteObject)
9+
- File Details (HeadObject)
10+
- List Objects (ListObjectsV2) with pagination
11+
- ListAll iterator (Go 1.23+) for memory-efficient iteration
12+
- Presigned URLs (GET/PUT with expiry)
13+
- Upload policies for browser POST uploads
14+
- IAM Role Support (EC2 instances with IMDSv2)
15+
- IAM token auto-renewal
16+
- Custom Metadata
17+
- Custom Endpoints (MinIO, DigitalOcean Spaces, etc.)
18+
- Content-Disposition and ACL support
19+
- Zero dependencies (stdlib only)
20+
21+
## v0.10.2 - Code Organization (Refactor)
22+
**Scope**: Internal restructuring, no API changes
23+
**Size**: Medium (refactor ~1064 LOC)
24+
25+
Split simples3.go into logical modules:
26+
- [ ] `simples3.go` - Core (S3 struct, New(), config methods: SetEndpoint/SetToken/SetClient)
27+
- [ ] `iam.go` - IAM (fetchIMDSToken, fetchIAMData, NewUsingIAM, renewIAMToken, SetIAMData)
28+
- [ ] `object.go` - Object ops (FileUpload, FilePut, FileDownload, FileDelete, FileDetails)
29+
- [ ] `list.go` - List ops (List, ListAll)
30+
- [ ] `helpers.go` - Utils (encodePath, detectFileSize, getFirstString, getURL)
31+
- [ ] Ensure all tests pass after refactor
32+
33+
**Why**: 1064-line file hard to navigate. Clean foundation before adding features.
34+
35+
---
36+
37+
## v0.11.0 - Bucket Operations
38+
**Scope**: Essential bucket management for CLI
39+
**Size**: Small (3 APIs, ~200 LOC)
40+
41+
- [ ] ListBuckets
42+
- [ ] CreateBucket (with region support)
43+
- [ ] DeleteBucket
44+
45+
**Why**: These 3 operations unblock CLI development. Minimal but complete.
46+
47+
---
48+
49+
## v0.12.0 - Object Operations (Copy & Batch Delete)
50+
**Scope**: Object manipulation for CLI mv/sync
51+
**Size**: Small (2 APIs, ~150 LOC)
52+
53+
- [ ] CopyObject (within/across buckets)
54+
- [ ] DeleteObjects (batch delete up to 1000 objects)
55+
56+
**Why**: CopyObject enables `mv` command. Batch delete improves performance.
57+
58+
---
59+
60+
## v0.13.0 - Multipart Upload
61+
**Scope**: Large file support
62+
**Size**: Large (5 APIs, ~400 LOC)
63+
64+
- [ ] InitiateMultipartUpload
65+
- [ ] UploadPart (with retry logic)
66+
- [ ] CompleteMultipartUpload
67+
- [ ] AbortMultipartUpload
68+
- [ ] ListParts
69+
70+
**Why**: Critical for large files. Enables resumable uploads.
71+
72+
---
73+
74+
## v0.14.0 - Server-Side Encryption
75+
**Scope**: Security basics
76+
**Size**: Small (~150 LOC)
77+
78+
- [ ] SSE-S3 support (AES256)
79+
- [ ] SSE-KMS support (key ARN)
80+
- [ ] Encryption headers in Put/Upload/Copy
81+
82+
**Why**: Security is table stakes. Simple to add to existing operations.
83+
84+
---
85+
86+
## v0.15.0 - Object Tagging
87+
**Scope**: Metadata management
88+
**Size**: Small (4 APIs, ~200 LOC)
89+
90+
- [ ] PutObjectTagging
91+
- [ ] GetObjectTagging
92+
- [ ] DeleteObjectTagging
93+
- [ ] Tagging support in Put/Upload/Copy
94+
95+
**Why**: Common requirement for organization/billing. Simple XML operations.
96+
97+
---
98+
99+
## v0.16.0 - Object Versioning
100+
**Scope**: Version control
101+
**Size**: Medium (5 APIs, ~300 LOC)
102+
103+
- [ ] PutBucketVersioning
104+
- [ ] GetBucketVersioning
105+
- [ ] ListObjectVersions
106+
- [ ] GetObjectVersion
107+
- [ ] DeleteObjectVersion (with version ID)
108+
109+
**Why**: Important for data safety. More complex due to version handling.
110+
111+
---
112+
113+
## v0.17.0 - ACLs & Lifecycle
114+
**Scope**: Advanced management
115+
**Size**: Medium (9 APIs, ~500 LOC)
116+
117+
ACLs:
118+
- [ ] PutObjectAcl
119+
- [ ] GetObjectAcl
120+
- [ ] PutBucketAcl
121+
- [ ] GetBucketAcl
122+
123+
Lifecycle:
124+
- [ ] PutBucketLifecycle
125+
- [ ] GetBucketLifecycle
126+
- [ ] DeleteBucketLifecycle
127+
128+
**Why**: Grouped advanced features. Completes library API surface.
129+
130+
---
131+
132+
## v0.18.0 - CLI Complete
133+
**Scope**: Full-featured CLI with all library features
134+
**Size**: Large (~2000 LOC)
135+
136+
CLI (`cmd/simples3/`):
137+
- [ ] Project structure (cobra or custom parser)
138+
- [ ] S3 URI parsing (`s3://bucket/key`)
139+
- [ ] Config (env vars: AWS_*, flags: --region/--profile)
140+
- [ ] AWS credentials file support (~/.aws/credentials)
141+
- [ ] Basic commands:
142+
- [ ] ls (list buckets/objects)
143+
- [ ] cp (upload/download, with multipart for large files)
144+
- [ ] rm (delete single/batch)
145+
- [ ] mb (make bucket)
146+
- [ ] rb (remove bucket)
147+
- [ ] mv (move/rename using copy+delete)
148+
- [ ] presign (generate URL)
149+
- [ ] sync (local ↔ S3 with diff algorithm)
150+
- [ ] Flags:
151+
- [ ] --recursive (cp/rm)
152+
- [ ] --sse/--sse-kms-key-id (encryption)
153+
- [ ] --tags (tagging)
154+
- [ ] --version-id (versioning)
155+
- [ ] --acl (canned ACLs)
156+
- [ ] --delete (sync)
157+
- [ ] --exclude/--include (patterns)
158+
- [ ] --json (output mode)
159+
- [ ] --dry-run
160+
- [ ] Features:
161+
- [ ] Progress indicators
162+
- [ ] Parallel transfers
163+
- [ ] Better error messages
164+
- [ ] Subcommands:
165+
- [ ] acl get/set
166+
- [ ] lifecycle get/set/delete
167+
- [ ] tags get/set/delete
168+
169+
**Why**: Library complete. Build full-featured CLI supporting all operations.
170+
171+
---
172+
173+
## v1.0.0 - Stable Release
174+
**Focus**: Production-ready stability
175+
**Size**: Documentation, tests, polish
176+
177+
Library:
178+
- [ ] All tests passing with 80%+ coverage
179+
- [ ] API documentation complete
180+
- [ ] Performance benchmarks
181+
- [ ] Security audit of signing/crypto code
182+
183+
CLI:
184+
- [ ] CLI tests with real/mocked S3
185+
- [ ] CLI documentation (man pages, --help)
186+
- [ ] Installation guides (brew, apt, etc.)
187+
- [ ] Shell completions (bash, zsh, fish)
188+
189+
Release:
190+
- [ ] CHANGELOG.md complete
191+
- [ ] Migration guide from v0.x
192+
- [ ] Examples for all features
193+
- [ ] API stability guarantee
194+
195+
**Why**: v1.0 = stability commitment. Library + CLI production-ready.

0 commit comments

Comments
 (0)