├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── codecov.yml ├── deprecated.go ├── go.mod ├── go.sum └── test ├── stream_deprecated.go ├── transport_deprecated.go └── utils_deprecated.go /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: 2 | - linux 3 | 4 | language: go 5 | 6 | go: 7 | - 1.11.x 8 | 9 | env: 10 | global: 11 | - GOTFLAGS="-race" 12 | matrix: 13 | - BUILD_DEPTYPE=gomod 14 | 15 | 16 | # disable travis install 17 | install: 18 | - true 19 | 20 | script: 21 | - bash <(curl -s https://raw.githubusercontent.com/ipfs/ci-helpers/master/travis-ci/run-standard-tests.sh) 22 | 23 | 24 | cache: 25 | directories: 26 | - $GOPATH/pkg/mod 27 | - $HOME/.cache/go-build 28 | 29 | notifications: 30 | email: false 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jeromy Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # go-libp2p-transport 2 | 3 | [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai) 4 | [![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](https://libp2p.io/) 5 | [![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23libp2p) 6 | [![GoDoc](https://godoc.org/github.com/libp2p/go-libp2p-transport?status.svg)](https://godoc.org/github.com/libp2p/go-libp2p-transport) 7 | [![Coverage Status](https://img.shields.io/codecov/c/github/libp2p/go-libp2p-transport.svg?style=flat-square&branch=master)](https://codecov.io/github/libp2p/go-libp2p-transport?branch=master) 8 | [![Build Status](https://travis-ci.org/libp2p/go-libp2p-transport.svg?branch=master)](https://travis-ci.org/libp2p/go-libp2p-transport) 9 | [![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io) 10 | 11 | > libp2p transport code 12 | 13 | A common interface for network transports. 14 | 15 | This is the 'base' layer for any transport that wants to be used by libp2p and ipfs. If you want to make 'ipfs work over X', the first thing you'll want to do is to implement the `Transport` interface for 'X'. 16 | 17 | Transports are: 18 | 19 | * Encrypted: Connections must be end-to-end encrypted. 20 | * Authenticated: The endpoints, RemotePeer and LocalPeer, must be authenticated. 21 | * Multiplexed: It must be possible to multiplex multiple reliable streams over a single transport connection. 22 | 23 | ## Install 24 | 25 | ```sh 26 | > go get github.com/libp2p/go-libp2p-transport 27 | ``` 28 | 29 | This repo is [gomod](https://github.com/golang/go/wiki/Modules)-compatible, and users of 30 | go 1.11 and later with modules enabled will automatically pull the latest tagged release 31 | by referencing this package. Upgrades to future releases can be managed using `go get`, 32 | or by editing your `go.mod` file as [described by the gomod documentation](https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies). 33 | 34 | ## Usage 35 | 36 | To actually *use* a transport, you'll likely want to register it with a `transport.Network` (e.g., [go-libp2p-swarm](https://github.com/libp2p/go-libp2p-swarm)). However, you're probably more interested in *implementing* transports. 37 | 38 | Transports construct fully featured, encrypted, multiplexed connections. However, there's a fairly good chance your transport won't meet all of those requirements. To make life easier, we've created a helper library called [go-libp2p-transport-upgrader](https://github.com/libp2p/go-libp2p-transport-upgrader) for upgrading simple stream transports to fully-featured (encrypted, authenticated, multiplexed) transports. Check out that package's [README](https://github.com/libp2p/go-libp2p-transport-upgrader/blob/master/README.md) for an example. 39 | 40 | ## Contribute 41 | 42 | Feel free to join in. All welcome. Open an [issue](https://github.com/libp2p/go-libp2p-transport/issues)! 43 | 44 | This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). 45 | 46 | ### Want to hack on IPFS? 47 | 48 | [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md) 49 | 50 | ## License 51 | 52 | MIT 53 | 54 | --- 55 | 56 | The last gx published version of this module was: 3.0.27: QmNQWMWWBmkAcaVEspSNwYB95axzKFhYTdqZtABA2zXoPu 57 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: "50...100" 3 | comment: off 4 | -------------------------------------------------------------------------------- /deprecated.go: -------------------------------------------------------------------------------- 1 | package transport 2 | 3 | import core "github.com/libp2p/go-libp2p-core/transport" 4 | 5 | // Deprecated: use github.com/libp2p/go-libp2p-core/transport.DialTimeout instead. 6 | // Warning: it's not possible to alias variables in Go. Setting a value here may have no effect. 7 | var DialTimeout = core.DialTimeout 8 | 9 | // Deprecated: use github.com/libp2p/go-libp2p-core/transport.AcceptTimeout instead. 10 | // Warning: it's not possible to alias variables in Go. Setting a value here may have no effect. 11 | var AcceptTimeout = core.AcceptTimeout 12 | 13 | // Deprecated: use github.com/libp2p/go-libp2p-core/transport.CapableConn instead. 14 | type Conn = core.CapableConn 15 | 16 | // Deprecated: use github.com/libp2p/go-libp2p-core/transport.Transport instead. 17 | type Transport = core.Transport 18 | 19 | // Deprecated: use github.com/libp2p/go-libp2p-core/transport.Listener instead. 20 | type Listener = core.Listener 21 | 22 | // Deprecated: use github.com/libp2p/go-libp2p-core/transport.TransportNetwork instead. 23 | type Network = core.TransportNetwork 24 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/libp2p/go-libp2p-transport 2 | 3 | require ( 4 | github.com/libp2p/go-libp2p-core v0.0.1 5 | github.com/libp2p/go-libp2p-testing v0.0.1 6 | github.com/multiformats/go-multiaddr v0.0.2 7 | ) 8 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= 2 | github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32 h1:qkOC5Gd33k54tobS36cXdAzJbeHaduLtnLQQwNoIi78= 3 | github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= 4 | github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= 5 | github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= 6 | github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= 7 | github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= 8 | github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= 9 | github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= 10 | github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= 11 | github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 12 | github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY= 13 | github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 14 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 15 | github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= 16 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 17 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 18 | github.com/gxed/hashland/keccakpg v0.0.1 h1:wrk3uMNaMxbXiHibbPO4S0ymqJMm41WiudyFSs7UnsU= 19 | github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= 20 | github.com/gxed/hashland/murmur3 v0.0.1 h1:SheiaIt0sda5K+8FLz952/1iWS9zrnKsEJaOJu4ZbSc= 21 | github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= 22 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 23 | github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= 24 | github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8 h1:bspPhN+oKYFk5fcGNuQzp6IGzYQSenLEgH3s6jkXrWw= 25 | github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= 26 | github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 27 | github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= 28 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 29 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 30 | github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= 31 | github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= 32 | github.com/libp2p/go-libp2p-core v0.0.1 h1:HSTZtFIq/W5Ue43Zw+uWZyy2Vl5WtF0zDjKN8/DT/1I= 33 | github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= 34 | github.com/libp2p/go-libp2p-testing v0.0.1 h1:zhr/Z0xWLgvbK3iSb+RYgbdJVVdawteUMvfkER5MvQ8= 35 | github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= 36 | github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= 37 | github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= 38 | github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16 h1:5W7KhL8HVF3XCFOweFD3BNESdnO8ewyYTFT2R+/b8FQ= 39 | github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= 40 | github.com/mr-tron/base58 v1.1.0 h1:Y51FGVJ91WBqCEabAi5OPUz38eAx8DakuAm5svLcsfQ= 41 | github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= 42 | github.com/mr-tron/base58 v1.1.1 h1:OJIdWOWYe2l5PQNgimGtuwHY8nDskvJ5vvs//YnzRLs= 43 | github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= 44 | github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= 45 | github.com/multiformats/go-multiaddr v0.0.2 h1:RBysRCv5rv3FWlhKWKoXv8tnsCUpEpIZpCmqAGZos2s= 46 | github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= 47 | github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= 48 | github.com/multiformats/go-multihash v0.0.1 h1:HHwN1K12I+XllBCrqKnhX949Orn4oawPkegHMu2vDqQ= 49 | github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= 50 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 51 | github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 52 | github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 53 | github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a h1:/eS3yfGjQKG+9kayBkj0ip1BGhq6zJ3eaVksphxAaek= 54 | github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= 55 | github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= 56 | github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= 57 | golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 58 | golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE= 59 | golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 60 | golang.org/x/crypto v0.0.0-20190225124518-7f87c0fbb88b h1:+/WWzjwW6gidDJnMKWLKLX1gxn7irUTF1fLpQovfQ5M= 61 | golang.org/x/crypto v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 62 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 63 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 64 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 65 | golang.org/x/sys v0.0.0-20190219092855-153ac476189d h1:Z0Ahzd7HltpJtjAHHxX8QFP3j1yYgiuvjbjRzDj/KH0= 66 | golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 67 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 68 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 69 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 70 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 71 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 72 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 73 | -------------------------------------------------------------------------------- /test/stream_deprecated.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/libp2p/go-libp2p-core/peer" 7 | "github.com/libp2p/go-libp2p-core/transport" 8 | "github.com/libp2p/go-libp2p-testing/suites/transport" 9 | 10 | ma "github.com/multiformats/go-multiaddr" 11 | ) 12 | 13 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.VerboseDebugging instead. 14 | // Warning: it's impossible to alias a var in go, so commented this var out for safety and to provoke breakage. 15 | // var VerboseDebugging = ttransport.VerboseDebugging 16 | 17 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.StressTestTimeout instead. 18 | // Warning: it's impossible to alias a var in go, so commented this var out for safety and to provoke breakage. 19 | // var StressTestTimeout = ttransport.StressTestTimeout 20 | 21 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.Options instead. 22 | type Options = ttransport.Options 23 | 24 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress instead. 25 | func SubtestStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID, opt Options) { 26 | ttransport.SubtestStress(t, ta, tb, maddr, peerA, opt) 27 | } 28 | 29 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStreamOpenStress instead. 30 | func SubtestStreamOpenStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 31 | ttransport.SubtestStreamOpenStress(t, ta, tb, maddr, peerA) 32 | } 33 | 34 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStreamReset instead. 35 | func SubtestStreamReset(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 36 | ttransport.SubtestStreamReset(t, ta, tb, maddr, peerA) 37 | } 38 | 39 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress1Conn1Stream1Msg instead. 40 | func SubtestStress1Conn1Stream1Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 41 | ttransport.SubtestStress1Conn1Stream1Msg(t, ta, tb, maddr, peerA) 42 | } 43 | 44 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress1Conn1Stream100Msg instead. 45 | func SubtestStress1Conn1Stream100Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 46 | ttransport.SubtestStress1Conn1Stream100Msg(t, ta, tb, maddr, peerA) 47 | } 48 | 49 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress1Conn100Stream100Msg instead. 50 | func SubtestStress1Conn100Stream100Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 51 | ttransport.SubtestStress1Conn100Stream100Msg(t, ta, tb, maddr, peerA) 52 | } 53 | 54 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress50Conn10Stream50Msg instead. 55 | func SubtestStress50Conn10Stream50Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 56 | ttransport.SubtestStress50Conn10Stream50Msg(t, ta, tb, maddr, peerA) 57 | } 58 | 59 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress1Conn1000Stream10Msg instead. 60 | func SubtestStress1Conn1000Stream10Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 61 | ttransport.SubtestStress1Conn1000Stream10Msg(t, ta, tb, maddr, peerA) 62 | } 63 | 64 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestStress1Conn100Stream100Msg10MB instead. 65 | func SubtestStress1Conn100Stream100Msg10MB(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 66 | ttransport.SubtestStress1Conn100Stream100Msg10MB(t, ta, tb, maddr, peerA) 67 | } 68 | -------------------------------------------------------------------------------- /test/transport_deprecated.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/libp2p/go-libp2p-core/peer" 7 | "github.com/libp2p/go-libp2p-core/transport" 8 | "github.com/libp2p/go-libp2p-testing/suites/transport" 9 | 10 | ma "github.com/multiformats/go-multiaddr" 11 | ) 12 | 13 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestProtocols instead. 14 | func SubtestProtocols(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 15 | ttransport.SubtestProtocols(t, ta, tb, maddr, peerA) 16 | } 17 | 18 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestBasic instead. 19 | func SubtestBasic(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 20 | ttransport.SubtestBasic(t, ta, tb, maddr, peerA) 21 | } 22 | 23 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestPingPong instead. 24 | func SubtestPingPong(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 25 | ttransport.SubtestPingPong(t, ta, tb, maddr, peerA) 26 | } 27 | 28 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestCancel instead. 29 | func SubtestCancel(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { 30 | ttransport.SubtestCancel(t, ta, tb, maddr, peerA) 31 | } 32 | -------------------------------------------------------------------------------- /test/utils_deprecated.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/libp2p/go-libp2p-core/peer" 7 | "github.com/libp2p/go-libp2p-core/transport" 8 | "github.com/libp2p/go-libp2p-testing/suites/transport" 9 | ) 10 | 11 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.Subtests instead. 12 | var Subtests = ttransport.Subtests 13 | 14 | // Deprecated: use github.com/libp2p/go-libp2p-testing/suites/transport.SubtestTransport instead. 15 | func SubtestTransport(t *testing.T, ta, tb transport.Transport, addr string, peerA peer.ID) { 16 | ttransport.SubtestTransport(t, ta, tb, addr, peerA) 17 | } 18 | --------------------------------------------------------------------------------