go-libp2p-core
                                
                                 go-libp2p-core copied to clipboard
                                
                                    go-libp2p-core copied to clipboard
                            
                            
                            
                        change interfaces for the security-in-multiaddr change
Changes to the Transport interface
Protocols() now returns a []ma.Protocol, not a slice of untyped ints. Note that this also changes the interpretation if more than one element is returned: So far, returning multiple protocols here meant that the Transport supports multiple protocols at the same time. Now it means that the Transports supports these protocols on top of each other.
Use case: We will have one TCP Transport that handles TLS and one TCP Transport that handles Noise handshakes (the handshake protocol will be taking from the multiaddr, and not negotiated using multistream). These transports will then return [ TCP, TLS ] and [ TCP, Noise ], respectively.
Changes to the SecureTransport interface
This PR adds Protocol method, returning the handshake protocol this SecureTransport uses. Examples: plaintextv2, TLS, Noise.
gocompat says:
Branch 'master' set up to track remote branch 'master' from 'origin'.
"github.com/libp2p/go-libp2p-core/sec".SecureTransport InterfaceChanged
"github.com/libp2p/go-libp2p-core/transport".Transport InterfaceChanged