forked from beyondstorage/go-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
33 lines (21 loc) · 745 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Package storage intends to provide a unified storage layer for Golang.
Goals
- Production ready: high test coverage, enterprise storage software adaptation, semantic versioning, well documented.
- High performance: more code generation, less runtime reflect.
- Vendor agnostic: more generic abstraction, less internal details.
Examples
The most common case to use a Storager service could be following:
1. Init a storager.
store, err := fs.NewStorager(pairs.WithWorkDir("/tmp"))
if err != nil {
log.Fatalf("service init failed: %v", err)
}
2. Use Storager API to maintain data.
var buf bytes.Buffer
n, err := store.Read("path/to/file", &buf)
if err != nil {
log.Printf("storager read: %v", err)
}
*/
package storage