Source File
proto.go
Belonging Package
github.com/libp2p/go-libp2p/p2p/host/autonat
package autonatimport (ma)// AutoNATProto identifies the autonat service protocolconst AutoNATProto = "/libp2p/autonat/1.0.0"func newDialMessage( peer.AddrInfo) *pb.Message {:= new(pb.Message).Type = pb.Message_DIAL.Enum().Dial = new(pb.Message_Dial).Dial.Peer = new(pb.Message_PeerInfo).Dial.Peer.Id = []byte(.ID).Dial.Peer.Addrs = make([][]byte, len(.Addrs))for , := range .Addrs {.Dial.Peer.Addrs[] = .Bytes()}return}func newDialResponseOK( ma.Multiaddr) *pb.Message_DialResponse {:= new(pb.Message_DialResponse).Status = pb.Message_OK.Enum().Addr = .Bytes()return}func newDialResponseError( pb.Message_ResponseStatus, string) *pb.Message_DialResponse {:= new(pb.Message_DialResponse).Status = .Enum().StatusText = &return}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |