Source File
opts.go
Belonging Package
github.com/libp2p/go-libp2p/p2p/protocol/identify
package identifyimporttype config struct {protocolVersion stringuserAgent stringdisableSignedPeerRecord boolmetricsTracer MetricsTracerdisableObservedAddrManager booltimeout time.Duration}// Option is an option function for identify.type Option func(*config)// ProtocolVersion sets the protocol version string that will be used to// identify the family of protocols used by the peer.func ( string) Option {return func( *config) {.protocolVersion =}}// UserAgent sets the user agent this node will identify itself with to peers.func ( string) Option {return func( *config) {.userAgent =}}// DisableSignedPeerRecord disables populating signed peer records on the outgoing Identify response// and ONLY sends the unsigned addresses.func () Option {return func( *config) {.disableSignedPeerRecord = true}}func ( MetricsTracer) Option {return func( *config) {.metricsTracer =}}// DisableObservedAddrManager disables the observed address manager. It also// effectively disables the nat emitter and EvtNATDeviceTypeChangedfunc () Option {return func( *config) {.disableObservedAddrManager = true}}// WithTimeout sets the timeout for identify interactions.func ( time.Duration) Option {return func( *config) {.timeout =}}
![]() |
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. |