Skip to content

Commit

Permalink
vendor for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
printfcoder committed Sep 24, 2020
1 parent 312fc34 commit 99e1875
Show file tree
Hide file tree
Showing 3,802 changed files with 880,885 additions and 143 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ module github.com/joincloud/peers-touch-go

go 1.14

replace (
// github.com/ipfs/go-ipfs v0.6.0 => ../go-ipfs
// github.com/libp2p/go-libp2p-pubsub v0.3.1 => ../go-libp2p-pubsub
// github.com/libp2p/go-libp2p-core v0.5.7 => ../go-libp2p-core
// github.com/libp2p/go-libp2p v0.9.6 => ../go-libp2p
// github.com/ipfs/go-ipfs v0.6.0 => ../go-ipfs
)

require (
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/uuid v1.1.2 // indirect
Expand Down
146 changes: 26 additions & 120 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pubsub/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (b *broker) Pub(ctx context.Context, event Event) (err error) {
if err != nil {
panic(err)
}

logger.Debugf("pub id: %s", id.ID())
err = b.coreAPI.PubSub().Publish(ctx, event.Name(), bytes)
if err != nil {
Expand Down
42 changes: 19 additions & 23 deletions tests/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,33 @@ package test

import (
"context"
"github.com/libp2p/go-libp2p"
"testing"
"time"

"github.com/joincloud/peers-touch-go/pubsub"
. "github.com/smartystreets/goconvey/convey"
"testing"

_ "github.com/joincloud/peers-touch-go/codec/json"
_ "github.com/joincloud/peers-touch-go/logger/logrus"
"github.com/joincloud/peers-touch-go/node"
)

func TestBrokerSub(t *testing.T) {
/*
mocknet := testingMockNet(ctx)
node, clean := testingIPFSNode(ctx, t, mocknet)
defer clean()
ctx := context.Background()

ipfs := testingCoreAPI(t, node)*/
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
mocknet := testingMockNet(ctx)
node, clean := testingIPFSNode(ctx, t, mocknet)
defer clean()

Convey("test ", t, FailureHalts, func(c C) {
h, _ := libp2p.New(ctx)
n, err := node.NewNode(ctx, node.Host(h))
_, _ = c.Printf("nodeId: %s\n", n.ID().String())
_, _ = c.Printf("hid: %s\n", h.ID().String())
ipfs := testingCoreAPI(t, node)

c.So(err, ShouldBeNil)
Convey("test ", t, FailureHalts, func(c C) {
Convey("Create Broker", FailureHalts, func(c C) {
b := pubsub.NewBroker(pubsub.BrokerCoreAPI(ipfs))
c.So(b, ShouldNotBeNil)

ok := make(chan bool)
Convey("Create Sub", FailureHalts, func(c C) {
sub, err := n.Broker().Sub(ctx, "topic-test", func(event pubsub.Event) {
sub, err := b.Sub(ctx, "topic-test", func(event pubsub.Event) {
_, _ = c.Printf("receive evt: %s-%s", event.Name(), event.Message())
ok <- true
})
Expand All @@ -44,14 +38,16 @@ func TestBrokerSub(t *testing.T) {
})

Convey("Create Pub", FailureHalts, func(c C) {
err := n.Broker().Pub(ctx, pubsub.NewEvent("topic-test", pubsub.Message{Body: "Hello Everybody"}))
err := b.Pub(ctx, pubsub.NewEvent("topic-test", pubsub.Message{Body: "Hello Everybody"}))
c.So(err, ShouldBeNil)
})

select {
case <-ok:
return
case <-time.After(time.Second * 4):
return
}
})
})

select {
case <-time.After(time.Second * 3):
return
}
}
2 changes: 2 additions & 0 deletions vendor/bazil.org/fuse/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions vendor/bazil.org/fuse/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 93 additions & 0 deletions vendor/bazil.org/fuse/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions vendor/bazil.org/fuse/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions vendor/bazil.org/fuse/buffer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/bazil.org/fuse/debug.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/bazil.org/fuse/error_darwin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions vendor/bazil.org/fuse/error_freebsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/bazil.org/fuse/error_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions vendor/bazil.org/fuse/error_std.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 99e1875

Please sign in to comment.