-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
46 lines (46 loc) · 1.42 KB
/
doc.go
File metadata and controls
46 lines (46 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Package trove provides a multi-backend object storage engine with
// bi-directional streaming, composable middleware, and first-class
// Forge transport integration.
//
// Trove is to object/file storage what Grove is to databases — a polyglot,
// driver-based abstraction that generates native operations per storage
// backend while delivering a unified, composable API surface.
//
// # Quick Start
//
// drv := localdriver.New()
// drv.Open(ctx, "file:///tmp/storage")
//
// t, err := trove.Open(drv)
// if err != nil {
// log.Fatal(err)
// }
// defer t.Close(ctx)
//
// // Upload an object.
// err = t.Put(ctx, "my-bucket", "hello.txt", strings.NewReader("hello world"))
//
// // Download an object.
// reader, err := t.Get(ctx, "my-bucket", "hello.txt")
// defer reader.Close()
//
// # Drivers
//
// Every storage backend registers as a driver — the same pattern Grove uses
// for pgdriver, mongodriver, etc. Available drivers:
//
// - localdriver: Local filesystem storage
// - memdriver: In-memory storage (testing)
// - s3driver: AWS S3, MinIO, R2, DigitalOcean Spaces (Phase 3)
// - gcsdriver: Google Cloud Storage (Phase 3)
// - azuredriver: Azure Blob Storage (Phase 3)
//
// # Multi-Backend Routing
//
// Trove supports multiple named backends simultaneously:
//
// t, err := trove.Open(primaryDriver,
// trove.WithBackend("archive", archiveDriver),
// trove.WithRoute("*.log", "archive"),
// )
package trove