Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
18da0a40
提交
18da0a40
authored
3月 25, 2016
作者:
Jeromy Johnson
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2503 from MichaelMure/pretty
clean deprecated Key.Pretty()
上级
78ac786c
c88e46cb
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
17 行增加
和
23 行删除
+17
-23
blockstore_test.go
blocks/blockstore/blockstore_test.go
+1
-1
key.go
blocks/key/key.go
+0
-6
block.go
core/commands/block.go
+1
-1
object.go
core/commands/object/object.go
+1
-1
refs.go
core/commands/refs.go
+5
-5
add.go
core/coreunix/add.go
+2
-2
message.go
exchange/bitswap/message/message.go
+1
-1
ipns_unix.go
fuse/ipns/ipns_unix.go
+1
-1
readonly_unix.go
fuse/readonly/readonly_unix.go
+1
-1
resolve_test.go
namesys/resolve_test.go
+1
-1
handlers.go
routing/dht/handlers.go
+2
-2
message.go
routing/dht/pb/message.go
+1
-1
没有找到文件。
blocks/blockstore/blockstore_test.go
浏览文件 @
18da0a40
...
...
@@ -82,7 +82,7 @@ func TestAllKeysSimple(t *testing.T) {
keys2
:=
collect
(
ch
)
// for _, k2 := range keys2 {
// t.Log("found ", k2.
Pretty
())
// t.Log("found ", k2.
B58String
())
// }
expectMatches
(
t
,
keys
,
keys2
)
...
...
blocks/key/key.go
浏览文件 @
18da0a40
...
...
@@ -14,12 +14,6 @@ type Key string
// String is utililty function for printing out keys as strings (Pretty).
func
(
k
Key
)
String
()
string
{
return
k
.
Pretty
()
}
// Pretty returns Key in a b58 encoded string
// TODO: deprecate Pretty. bad name.
func
(
k
Key
)
Pretty
()
string
{
return
k
.
B58String
()
}
...
...
core/commands/block.go
浏览文件 @
18da0a40
...
...
@@ -65,7 +65,7 @@ on raw ipfs blocks. It outputs the following to stdout:
}
res
.
SetOutput
(
&
BlockStat
{
Key
:
b
.
Key
()
.
Pretty
(),
Key
:
b
.
Key
()
.
B58String
(),
Size
:
len
(
b
.
Data
),
})
},
...
...
core/commands/object/object.go
浏览文件 @
18da0a40
...
...
@@ -550,7 +550,7 @@ func getOutput(dagnode *dag.Node) (*Object, error) {
}
output
:=
&
Object
{
Hash
:
key
.
Pretty
(),
Hash
:
key
.
B58String
(),
Links
:
make
([]
Link
,
len
(
dagnode
.
Links
)),
}
...
...
core/commands/refs.go
浏览文件 @
18da0a40
...
...
@@ -176,7 +176,7 @@ Displays the hashes of all local objects.
defer
pipew
.
Close
()
for
k
:=
range
allKeys
{
s
:=
k
.
Pretty
()
+
"
\n
"
s
:=
k
.
B58String
()
+
"
\n
"
if
_
,
err
:=
pipew
.
Write
([]
byte
(
s
));
err
!=
nil
{
log
.
Error
(
"pipe write error: "
,
err
)
return
...
...
@@ -314,13 +314,13 @@ func (rw *RefWriter) WriteEdge(from, to key.Key, linkname string) error {
switch
{
case
rw
.
PrintFmt
!=
""
:
s
=
rw
.
PrintFmt
s
=
strings
.
Replace
(
s
,
"<src>"
,
from
.
Pretty
(),
-
1
)
s
=
strings
.
Replace
(
s
,
"<dst>"
,
to
.
Pretty
(),
-
1
)
s
=
strings
.
Replace
(
s
,
"<src>"
,
from
.
B58String
(),
-
1
)
s
=
strings
.
Replace
(
s
,
"<dst>"
,
to
.
B58String
(),
-
1
)
s
=
strings
.
Replace
(
s
,
"<linkname>"
,
linkname
,
-
1
)
case
rw
.
PrintEdge
:
s
=
from
.
Pretty
()
+
" -> "
+
to
.
Pretty
()
s
=
from
.
B58String
()
+
" -> "
+
to
.
B58String
()
default
:
s
+=
to
.
Pretty
()
s
+=
to
.
B58String
()
}
rw
.
out
<-
&
RefWrapper
{
Ref
:
s
}
...
...
core/coreunix/add.go
浏览文件 @
18da0a40
...
...
@@ -323,7 +323,7 @@ func (adder *Adder) addNode(node *dag.Node, path string) error {
return
err
}
path
=
key
.
Pretty
()
path
=
key
.
B58String
()
}
dir
:=
gopath
.
Dir
(
path
)
...
...
@@ -479,7 +479,7 @@ func getOutput(dagnode *dag.Node) (*Object, error) {
}
output
:=
&
Object
{
Hash
:
key
.
Pretty
(),
Hash
:
key
.
B58String
(),
Links
:
make
([]
Link
,
len
(
dagnode
.
Links
)),
}
...
...
exchange/bitswap/message/message.go
浏览文件 @
18da0a40
...
...
@@ -173,7 +173,7 @@ func (m *impl) ToNet(w io.Writer) error {
func
(
m
*
impl
)
Loggable
()
map
[
string
]
interface
{}
{
var
blocks
[]
string
for
_
,
v
:=
range
m
.
blocks
{
blocks
=
append
(
blocks
,
v
.
Key
()
.
Pretty
())
blocks
=
append
(
blocks
,
v
.
Key
()
.
B58String
())
}
return
map
[
string
]
interface
{}{
"blocks"
:
blocks
,
...
...
fuse/ipns/ipns_unix.go
浏览文件 @
18da0a40
...
...
@@ -241,7 +241,7 @@ func (r *Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
continue
}
ent
:=
fuse
.
Dirent
{
Name
:
key
.
Key
(
hash
)
.
Pretty
(),
Name
:
key
.
Key
(
hash
)
.
B58String
(),
Type
:
fuse
.
DT_Dir
,
}
link
:=
fuse
.
Dirent
{
...
...
fuse/readonly/readonly_unix.go
浏览文件 @
18da0a40
...
...
@@ -171,7 +171,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
// setup our logging event
lm
:=
make
(
lgbl
.
DeferredMap
)
lm
[
"fs"
]
=
"ipfs"
lm
[
"key"
]
=
func
()
interface
{}
{
return
k
.
Pretty
()
}
lm
[
"key"
]
=
func
()
interface
{}
{
return
k
.
B58String
()
}
lm
[
"req_offset"
]
=
req
.
Offset
lm
[
"req_size"
]
=
req
.
Size
defer
log
.
EventBegin
(
ctx
,
"fuseRead"
,
lm
)
.
Done
()
...
...
namesys/resolve_test.go
浏览文件 @
18da0a40
...
...
@@ -42,7 +42,7 @@ func TestRoutingResolve(t *testing.T) {
}
pkhash
:=
u
.
Hash
(
pubkb
)
res
,
err
:=
resolver
.
Resolve
(
context
.
Background
(),
key
.
Key
(
pkhash
)
.
Pretty
())
res
,
err
:=
resolver
.
Resolve
(
context
.
Background
(),
key
.
Key
(
pkhash
)
.
B58String
())
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
routing/dht/handlers.go
浏览文件 @
18da0a40
...
...
@@ -210,7 +210,7 @@ func (dht *IpfsDHT) handleGetProviders(ctx context.Context, p peer.ID, pmes *pb.
resp
:=
pb
.
NewMessage
(
pmes
.
GetType
(),
pmes
.
GetKey
(),
pmes
.
GetClusterLevel
())
key
:=
key
.
Key
(
pmes
.
GetKey
())
lm
[
"key"
]
=
func
()
interface
{}
{
return
key
.
Pretty
()
}
lm
[
"key"
]
=
func
()
interface
{}
{
return
key
.
B58String
()
}
// debug logging niceness.
reqDesc
:=
fmt
.
Sprintf
(
"%s handleGetProviders(%s, %s): "
,
dht
.
self
,
p
,
key
)
...
...
@@ -254,7 +254,7 @@ func (dht *IpfsDHT) handleAddProvider(ctx context.Context, p peer.ID, pmes *pb.M
defer
log
.
EventBegin
(
ctx
,
"handleAddProvider"
,
lm
)
.
Done
()
key
:=
key
.
Key
(
pmes
.
GetKey
())
lm
[
"key"
]
=
func
()
interface
{}
{
return
key
.
Pretty
()
}
lm
[
"key"
]
=
func
()
interface
{}
{
return
key
.
B58String
()
}
log
.
Debugf
(
"%s adding %s as a provider for '%s'
\n
"
,
dht
.
self
,
p
,
key
)
...
...
routing/dht/pb/message.go
浏览文件 @
18da0a40
...
...
@@ -143,7 +143,7 @@ func (m *Message) Loggable() map[string]interface{} {
return
map
[
string
]
interface
{}{
"message"
:
map
[
string
]
string
{
"type"
:
m
.
Type
.
String
(),
"key"
:
key
.
Key
(
m
.
GetKey
())
.
Pretty
(),
"key"
:
key
.
Key
(
m
.
GetKey
())
.
B58String
(),
},
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论