Commit 0f8b6032 authored by Kevin Atkinson's avatar Kevin Atkinson Committed by Jeromy

cleanup and bug fixes

License: MIT
Signed-off-by: default avatarKevin Atkinson <k@kevina.org>
parent 7875674c
package config
import (
"encoding/json"
)
// DefaultDataStoreDirectory is the directory to store all the local IPFS data.
const DefaultDataStoreDirectory = "datastore"
......@@ -8,8 +12,12 @@ type Datastore struct {
StorageMax string // in B, kB, kiB, MB, ...
StorageGCWatermark int64 // in percentage to multiply on StorageMax
GCPeriod string // in ns, us, ms, s, m, h
Path string
NoSync bool // deprecated
// deprecated fields, use Spec
Type string `json:",omitempty"`
Path string `json:",omitempty"`
NoSync bool `json:",omitempty"`
Params *json.RawMessage `json:",omitempty"`
Spec map[string]interface{}
......@@ -17,27 +25,6 @@ type Datastore struct {
BloomFilterSize int
}
type S3Datastore struct {
Region string `json:"region"`
Bucket string `json:"bucket"`
ACL string `json:"acl"`
}
type FlatDS struct {
Path string
ShardFunc string
Sync bool
}
type LevelDB struct {
Path string
Compression string
}
type SbsDS struct {
Path string
}
// DataStorePath returns the default data store path given a configuration root
// (set an empty string to have the default configuration root)
func DataStorePath(configroot string) (string, error) {
......
......@@ -95,7 +95,7 @@ func datastoreConfig() (*Datastore, error) {
"child": map[string]interface{}{
"type": "flatfs",
"path": "blocks",
"nosync": false,
"sync": true,
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
},
},
......
......@@ -94,7 +94,7 @@ func (r *FSRepo) openFlatfsDatastore(params map[string]interface{}) (repo.Datast
return nil, err
}
return flatfs.CreateOrOpen(p, shardFun, params["nosync"].(bool))
return flatfs.CreateOrOpen(p, shardFun, params["sync"].(bool))
}
func (r *FSRepo) openLeveldbDatastore(params map[string]interface{}) (repo.Datastore, error) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment