https://github.com/jobstoit/s3io
Golang native read/writes on s3 objects
https://github.com/jobstoit/s3io
files go golang golang-package object-storage s3
Last synced: about 1 month ago
JSON representation
Golang native read/writes on s3 objects
- Host: GitHub
- URL: https://github.com/jobstoit/s3io
- Owner: jobstoit
- License: mit
- Created: 2024-04-21T21:23:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-21T05:56:23.000Z (2 months ago)
- Last Synced: 2026-01-21T17:35:23.076Z (2 months ago)
- Topics: files, go, golang, golang-package, object-storage, s3
- Language: Go
- Homepage: https://pkg.go.dev/github.com/jobstoit/s3io/v3
- Size: 255 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# S3IO
[](https://pkg.go.dev/github.com/jobstoit/s3io/v3)
[](https://goreportcard.com/report/github.com/jobstoit/s3io/v3)
An abstraction layer on top of the s3 sdk to do io read/write opperations on s3 objects.
The s3io reader and writer stream the objects from and to your s3 instance while being memory efficient.
```go
// Note the "WithBucket..." are options
bucket, err := s3io.Open(ctx, "my-bucket-name", s3io.WithBucketCredentials(accessKey, secretKey))
if err != nil {
return err
}
// Note the "WithWriter..." are options specifically for this writer session
writer := bucket.Put(ctx, "path/to/object.txt", s3io.WithWriterRetries(3))
defer writer.Close() // makes sure your upload won't keep hanging
if _, err := io.WriteString(writer, "Hello world!"); err != nil {
return err
}
if err := writer.Close(); err != nil {
return err
}
reader := bucket.Get(ctx, "path/to/object.txt")
_, err := io.Copy(os.Stdout, reader)
...
```