Skip to content

An application-oriented unified storage layer for Golang.

License

Notifications You must be signed in to change notification settings

ccamel/storage

 
 

Repository files navigation

storage

Build Status GoDoc Go Report Card codecov License

A unified storage layer for Golang.

Goal

  • Production ready
  • High performance
  • Vendor lock free

Current Status

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.

Installation

Install will go get

go get -u github.com/Xuanwo/storage

Import

import "github.com/Xuanwo/storage"

Quickstart

// 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)
}

Services

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

azblob://hmac:<access_key>:<secret_key>/<bucket_name>/<prefix>

fs

fs:///path/to/dir

gcs

gcs://apikey:<api_key>/<bucket_name>/<prefix>?project=<project_id>

oss

oss://hmac:<access_key>:<secret_key>@<protocol>:<host>:<port>/<bucket_name>/<prefix>

qingstor

qingstor://hmac:<access_key>:<secret_key>@<protocol>:<host>:<port>/<bucket_name>/<prefix>

s3

s3://hmac:<access_key>:<secret_key>/<bucket_name>/<prefix>

About

An application-oriented unified storage layer for Golang.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.1%
  • Makefile 0.9%