Permalink
Browse files

Update gx packages

  • Loading branch information...
willhite committed Oct 28, 2017
1 parent 4583b18 commit 00e7a202b3b5b79b2152d51201b1ad2ccb3bd387
Showing 1,299 changed files with 253,869 additions and 37,134 deletions.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,13 @@
# go-smux-multistream - a go-stream-muxer shim for multistream
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![](https://raw.githubusercontent.com/libp2p/go-stream-muxer/master/img/badge.png)
This is an implementation of the [go-stream-muxer](https://github.com/libp2p/go-stream-muxer) interface for [multistream](https://github.com/whyrusleeping/go-multistream). For more information, see that repo.
## Installation
```sh
go get -d github.com/whyrusleeping/go-smux-yamux
cd $GOPATH/src/github.com/whyrusleeping/go-smux-yamux
make deps
```
@@ -0,0 +1,29 @@
{
"author": "whyrusleeping",
"bugs": {
"url": "https://github.com/whyrusleeping/go-smux-yamux"
},
"gx": {
"dvcsimport": "github.com/whyrusleeping/go-smux-yamux"
},
"gxDependencies": [
{
"author": "whyrusleeping",
"hash": "QmVxf27kucSvCLiCq6dAXjDU2WG3xZN9ae7Ny6osroP28u",
"name": "yamux",
"version": "1.0.5"
},
{
"author": "whyrusleeping",
"hash": "QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw",
"name": "go-stream-muxer",
"version": "3.0.0"
}
],
"gxVersion": "0.7.0",
"language": "go",
"license": "",
"name": "go-smux-yamux",
"version": "2.0.1"
}
@@ -0,0 +1,70 @@
package sm_yamux
import (
"io/ioutil"
"net"
"time"
yamux "gx/ipfs/QmVxf27kucSvCLiCq6dAXjDU2WG3xZN9ae7Ny6osroP28u/yamux"
smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer"
)
// Conn is a connection to a remote peer.
type conn yamux.Session
func (c *conn) yamuxSession() *yamux.Session {
return (*yamux.Session)(c)
}
func (c *conn) Close() error {
return c.yamuxSession().Close()
}
func (c *conn) IsClosed() bool {
return c.yamuxSession().IsClosed()
}
// OpenStream creates a new stream.
func (c *conn) OpenStream() (smux.Stream, error) {
s, err := c.yamuxSession().OpenStream()
if err != nil {
return nil, err
}
return s, nil
}
// AcceptStream accepts a stream opened by the other side.
func (c *conn) AcceptStream() (smux.Stream, error) {
s, err := c.yamuxSession().AcceptStream()
return s, err
}
// Transport is a go-peerstream transport that constructs
// yamux-backed connections.
type Transport yamux.Config
// DefaultTransport has default settings for yamux
var DefaultTransport = (*Transport)(&yamux.Config{
AcceptBacklog: 256, // from yamux.DefaultConfig
EnableKeepAlive: true, // from yamux.DefaultConfig
KeepAliveInterval: 30 * time.Second, // from yamux.DefaultConfig
ConnectionWriteTimeout: 10 * time.Second, // from yamux.DefaultConfig
MaxStreamWindowSize: uint32(256 * 1024), // from yamux.DefaultConfig
LogOutput: ioutil.Discard,
})
func (t *Transport) NewConn(nc net.Conn, isServer bool) (smux.Conn, error) {
var s *yamux.Session
var err error
if isServer {
s, err = yamux.Server(nc, t.Config())
} else {
s, err = yamux.Client(nc, t.Config())
}
return (*conn)(s), err
}
func (t *Transport) Config() *yamux.Config {
return (*yamux.Config)(t)
}
@@ -0,0 +1,11 @@
package sm_yamux
import (
"testing"
test "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer/test"
)
func TestYamuxTransport(t *testing.T) {
test.SubtestAll(t, DefaultTransport)
}
@@ -0,0 +1,43 @@
# go-libp2p-net
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-libp2p-blue.svg?style=flat-square)](http://github.com/libp2p/libp2p)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
> Network interfaces for go-libp2p
The IPFS Network package handles all of the peer-to-peer networking. It connects to other hosts, it encrypts communications, it muxes messages between the network's client services and target hosts. It has multiple subcomponents:
- `Conn` - a connection to a single Peer
- `MultiConn` - a set of connections to a single Peer
- `SecureConn` - an encrypted (tls-like) connection
- `Swarm` - holds connections to Peers, multiplexes from/to each `MultiConn`
- `Muxer` - multiplexes between `Services` and `Swarm`. Handles `Requet/Reply`.
- `Service` - connects between an outside client service and Network.
- `Handler` - the client service part that handles requests
It looks a bit like this:
[![](https://docs.google.com/drawings/d/1FvU7GImRsb9GvAWDDo1le85jIrnFJNVB_OTPXC15WwM/pub?h=480)]
## Install
```sh
go get libp2p/go-libp2p-net
```
## Contribute
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/go-libp2p-net/issues)!
Check out our [contributing document](https://github.com/libp2p/community/blob/master/CONTRIBUTE.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to libp2p are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
### Want to hack on IPFS?
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
## License
[MIT](LICENSE) © 2016 Jeromy Johnson
Oops, something went wrong.

0 comments on commit 00e7a20

Please sign in to comment.