go-ipfs-config: cleanup and bug fixes
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
Kevin Atkinson committed
May 10, 2017 at 03:48 UTC
94a60d3bc70ddaf2aeecc5906baa3a3286b2278e
2 files changed
+11
-24
config/datastore.go
+10
-23
@@ -1,5 +1,9 @@
1
package config
2
3
+import (
4
+ "encoding/json"
5
+)
6
+
7
// DefaultDataStoreDirectory is the directory to store all the local IPFS data.
8
const DefaultDataStoreDirectory = "datastore"
9
@@ -8,8 +12,12 @@ type Datastore struct {
12
StorageMax string // in B, kB, kiB, MB, ...
13
StorageGCWatermark int64 // in percentage to multiply on StorageMax
14
GCPeriod string // in ns, us, ms, s, m, h
11
- Path string
12
- NoSync bool // deprecated
15
+
16
+ // deprecated fields, use Spec
17
+ Type string `json:",omitempty"`
18
+ Path string `json:",omitempty"`
19
+ NoSync bool `json:",omitempty"`
20
+ Params *json.RawMessage `json:",omitempty"`
21
22
Spec map[string]interface{}
23
@@ -17,27 +25,6 @@ type Datastore struct {
25
BloomFilterSize int
26
}
27
20
-type S3Datastore struct {
21
- Region string `json:"region"`
22
- Bucket string `json:"bucket"`
23
- ACL string `json:"acl"`
24
-}
25
-
26
-type FlatDS struct {
27
- Path string
28
- ShardFunc string
29
- Sync bool
30
-}
31
-
32
-type LevelDB struct {
33
- Path string
34
- Compression string
35
-}
36
-
37
-type SbsDS struct {
38
- Path string
39
-}
40
-
28
// DataStorePath returns the default data store path given a configuration root
29
// (set an empty string to have the default configuration root)
30
func DataStorePath(configroot string) (string, error) {
config/init.go
+1
-1
@@ -95,7 +95,7 @@ func datastoreConfig() (*Datastore, error) {
95
"child": map[string]interface{}{
96
"type": "flatfs",
97
"path": "blocks",
98
- "nosync": false,
98
+ "sync": true,
99
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
100
},
101
},