storage
![Join the chat](https://img.shields.io/badge/chat-online-blue?style=flat&logo=telegram)
An application-oriented unified storage layer for Golang.
Goal
- Production ready
- High performance
- Vendor lock free
Features
Servicer Level
- Basic operations across implemented storage services with the same API
- List: list all Storager in service
- Get: get a Storager via name
- Create: create a Storager
- Delete: delete a Storager
Storager Level
- Basic operations across all storage services with the same API
- Read: read file content
- Write: write content into file
- List: list files under a dir or prefix
- Stat: get file's metadata
- Delete: delete a file
- Metadata: get storage service's metadata
- Advanced operations across implemented storage services with the same API
- Copy: copy a file
- Move: move a file
- Reach: generate a public accessible url
- Statistical: get storage service's statistics
- Segment: Full support for Segment, aka, Multipart
File Level
- Metadata
- Content Length / Size: Full support via RFC 2616
- Content MD5 / ETag: Full support via proposal
- Content Type: Full support via RFC 2616
- Storage Class: Full support via proposal
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 github.com/Xuanwo/storage
Import
import "github.com/Xuanwo/storage"
Quick Start
store, err := coreutils.OpenStorager("fs", pairs.WithWorkDir("/tmp"))
if err != nil {
log.Fatalf("service init failed: %v", err)
}
r, err := store.Read("path/to/file")
if err != nil {
log.Printf("storager read: %v", err)
}
Services