Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
0f8b6032
提交
0f8b6032
authored
5月 10, 2017
作者:
Kevin Atkinson
提交者:
Jeromy
9月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup and bug fixes
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
上级
7875674c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
12 行增加
和
25 行删除
+12
-25
datastore.go
repo/config/datastore.go
+10
-23
init.go
repo/config/init.go
+1
-1
datastores.go
repo/fsrepo/datastores.go
+1
-1
没有找到文件。
repo/config/datastore.go
浏览文件 @
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
浏览文件 @
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"
,
"
nosync"
:
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
浏览文件 @
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
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论