A unified storage layer for Golang.
- Production ready
- High performance
- Vendor lock free
This lib is in heavy development, break changes could be introduced at any time. All public interface or functions expected to be stable at v1.0.0
.
Install will go get
go get -u github.com/Xuanwo/storage
Import
import "github.com/Xuanwo/storage"
// Init a service.
srv, store, err := coreutils.Open("qingstor://hmac:test_access_key:test_secret_key@https:qingstor.com:443/test_bucket_name")
if err != nil {
log.Fatalf("service init failed: %v", err)
}
// Use Storager API to maintain data.
ch := make(chan *types.Object, 1)
defer close(ch)
err := store.List("prefix", pairs.WithFileFunc(func(*types.Object){
ch <- o
}))
if err != nil {
log.Printf("storager listdir failed: %v", err)
}
Service | Description | Status |
---|---|---|
azblob | Azure Blob storage | alpha (-segments, -unittests) |
cos | Tencent Cloud Object Storage | planned |
fs | Local file system | stable (-segments) |
gcs | Google Cloud Storage | alpha (-segments, -unittests) |
kodo | qiniu kodo | planned |
oss | Aliyun Object Storage | alpha (-segments, -unittests) |
qingstor | QingStor Object Storage | stable |
s3 | Amazon S3 | alpha (-segments, -unittests) |
uss | UPYUN Storage Service | planned |
azblob://hmac:<access_key>:<secret_key>/<bucket_name>/<prefix>
fs:///path/to/dir
gcs://apikey:<api_key>/<bucket_name>/<prefix>?project=<project_id>
oss://hmac:<access_key>:<secret_key>@<protocol>:<host>:<port>/<bucket_name>/<prefix>
qingstor://hmac:<access_key>:<secret_key>@<protocol>:<host>:<port>/<bucket_name>/<prefix>
s3://hmac:<access_key>:<secret_key>/<bucket_name>/<prefix>