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-unixfs
Commits
ba510cbd
Commit
ba510cbd
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IpnsPublicher -> Publisher interface
parent
19b0a28d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
core/core.go
core/core.go
+1
-1
namesys/publisher.go
namesys/publisher.go
+8
-4
namesys/resolve_test.go
namesys/resolve_test.go
+1
-1
No files found.
core/core.go
View file @
ba510cbd
...
...
@@ -64,7 +64,7 @@ type IpfsNode struct {
Namesys
namesys
.
Resolver
// the routing publisher
Publisher
*
namesys
.
Ipns
Publisher
Publisher
namesys
.
Publisher
}
// NewIpfsNode constructs a new IpfsNode based on the given config.
...
...
This diff is collapsed.
Click to expand it.
namesys/publisher.go
View file @
ba510cbd
...
...
@@ -12,20 +12,24 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
type
I
pnsPublisher
struct
{
type
i
pnsPublisher
struct
{
dag
*
mdag
.
DAGService
routing
routing
.
IpfsRouting
}
func
NewPublisher
(
dag
*
mdag
.
DAGService
,
route
routing
.
IpfsRouting
)
*
IpnsPublisher
{
return
&
IpnsPublisher
{
type
Publisher
interface
{
Publish
(
ci
.
PrivKey
,
string
)
error
}
func
NewPublisher
(
dag
*
mdag
.
DAGService
,
route
routing
.
IpfsRouting
)
Publisher
{
return
&
ipnsPublisher
{
dag
:
dag
,
routing
:
route
,
}
}
// Publish accepts a keypair and a value,
func
(
p
*
I
pnsPublisher
)
Publish
(
k
ci
.
PrivKey
,
value
string
)
error
{
func
(
p
*
i
pnsPublisher
)
Publish
(
k
ci
.
PrivKey
,
value
string
)
error
{
log
.
Debug
(
"namesys: Publish %s"
,
value
)
ctx
:=
context
.
TODO
()
data
,
err
:=
CreateEntryData
(
k
,
value
)
...
...
This diff is collapsed.
Click to expand it.
namesys/resolve_test.go
View file @
ba510cbd
...
...
@@ -28,7 +28,7 @@ func TestRoutingResolve(t *testing.T) {
resolve
:=
NewMasterResolver
(
d
,
dag
)
pub
:=
I
pnsPublisher
{
pub
:=
i
pnsPublisher
{
dag
:
dag
,
routing
:
d
,
}
...
...
This diff is collapsed.
Click to expand it.
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