Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
0f8b6032
Commit
0f8b6032
authored
May 10, 2017
by
Kevin Atkinson
Committed by
Jeromy
Sep 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup and bug fixes
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
parent
7875674c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
25 deletions
+12
-25
repo/config/datastore.go
repo/config/datastore.go
+10
-23
repo/config/init.go
repo/config/init.go
+1
-1
repo/fsrepo/datastores.go
repo/fsrepo/datastores.go
+1
-1
No files found.
repo/config/datastore.go
View file @
0f8b6032
package
config
package
config
import
(
"encoding/json"
)
// DefaultDataStoreDirectory is the directory to store all the local IPFS data.
// DefaultDataStoreDirectory is the directory to store all the local IPFS data.
const
DefaultDataStoreDirectory
=
"datastore"
const
DefaultDataStoreDirectory
=
"datastore"
...
@@ -8,8 +12,12 @@ type Datastore struct {
...
@@ -8,8 +12,12 @@ type Datastore struct {
StorageMax
string
// in B, kB, kiB, MB, ...
StorageMax
string
// in B, kB, kiB, MB, ...
StorageGCWatermark
int64
// in percentage to multiply on StorageMax
StorageGCWatermark
int64
// in percentage to multiply on StorageMax
GCPeriod
string
// in ns, us, ms, s, m, h
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
{}
Spec
map
[
string
]
interface
{}
...
@@ -17,27 +25,6 @@ type Datastore struct {
...
@@ -17,27 +25,6 @@ type Datastore struct {
BloomFilterSize
int
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
// DataStorePath returns the default data store path given a configuration root
// (set an empty string to have the default configuration root)
// (set an empty string to have the default configuration root)
func
DataStorePath
(
configroot
string
)
(
string
,
error
)
{
func
DataStorePath
(
configroot
string
)
(
string
,
error
)
{
...
...
repo/config/init.go
View file @
0f8b6032
...
@@ -95,7 +95,7 @@ func datastoreConfig() (*Datastore, error) {
...
@@ -95,7 +95,7 @@ func datastoreConfig() (*Datastore, error) {
"child"
:
map
[
string
]
interface
{}{
"child"
:
map
[
string
]
interface
{}{
"type"
:
"flatfs"
,
"type"
:
"flatfs"
,
"path"
:
"blocks"
,
"path"
:
"blocks"
,
"
no
sync"
:
fals
e
,
"sync"
:
tru
e
,
"shardFunc"
:
"/repo/flatfs/shard/v1/next-to-last/2"
,
"shardFunc"
:
"/repo/flatfs/shard/v1/next-to-last/2"
,
},
},
},
},
...
...
repo/fsrepo/datastores.go
View file @
0f8b6032
...
@@ -94,7 +94,7 @@ func (r *FSRepo) openFlatfsDatastore(params map[string]interface{}) (repo.Datast
...
@@ -94,7 +94,7 @@ func (r *FSRepo) openFlatfsDatastore(params map[string]interface{}) (repo.Datast
return
nil
,
err
return
nil
,
err
}
}
return
flatfs
.
CreateOrOpen
(
p
,
shardFun
,
params
[
"
no
sync"
]
.
(
bool
))
return
flatfs
.
CreateOrOpen
(
p
,
shardFun
,
params
[
"sync"
]
.
(
bool
))
}
}
func
(
r
*
FSRepo
)
openLeveldbDatastore
(
params
map
[
string
]
interface
{})
(
repo
.
Datastore
,
error
)
{
func
(
r
*
FSRepo
)
openLeveldbDatastore
(
params
map
[
string
]
interface
{})
(
repo
.
Datastore
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment