Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jritsema/s3lib
Just another go library for s3 that makes it a little easier to work with
https://github.com/jritsema/s3lib
client go s3
Last synced: 27 days ago
JSON representation
Just another go library for s3 that makes it a little easier to work with
- Host: GitHub
- URL: https://github.com/jritsema/s3lib
- Owner: jritsema
- License: mit
- Created: 2020-11-20T19:32:10.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-24T02:55:07.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T06:32:59.806Z (7 months ago)
- Topics: client, go, s3
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s3lib
Just another go library for s3 that makes it a little easier to work with.
### API
#### Utilities
- NewClient
- NewClientWithSession
- NewClientWithConfig
- BucketKeyExists
- DownloadFile
- UploadDirectory
- UploadFile
- GetPresignedURL#### Object Persistence
- GetObject
- GetString
- PutObject
- DeleteObject
- PutContent
- List
- KeyExists### Usage
```
go get github.com/jritsema/s3lib
``````go
s3, err := s3lib.NewClient("my-bucket", "us-east-1")
check(err)//save an object
obj := &myType{version: "1.0"}
key := "mykey"
err = s3.PutObject(key, obj)
check(err)//fetch
_, err = s3.GetObject(key, obj)
check(err)//update
obj.version = "2.0"
err = s3.PutObject(key, obj)
check(err)//delete
err = s3.DeleteObject(key)
check(err)
```