{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v0.6.1-preview","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package discovery\n\n## Types\n\n```go\ntype Discovery interface {\n\tAddNode(string) bool           // Add an address to the discovery list\n\tRemoveNode(string) bool        // Remove an address from the discovery list\n\tGetAllNodes() []string         // Return all addresses this peer maintains\n\tGetRandomNodes(n int) []string // Return n random addresses for this peer to connect to\n\tFindNode(string) bool          // Find a node in the discovery list\n}\n```\nDiscovery is the interface that consolidates bootstrap peer membership selection and validating peer selection for non-validating peers\n\n```go\ntype DiscoveryImpl struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nDiscoveryImpl is an implementation of Discovery\n\n```go\nfunc NewDiscoveryImpl() *DiscoveryImpl\n```\nNewDiscoveryImpl is a constructor of a Discovery implementation\n\n```go\nfunc (di *DiscoveryImpl) AddNode(address string) bool\n```\nAddNode adds an address to the discovery list\n\n```go\nfunc (di *DiscoveryImpl) FindNode(address string) bool\n```\nFindNode returns true if its address is stored in the discovery list\n\n```go\nfunc (di *DiscoveryImpl) GetAllNodes() []string\n```\nGetAllNodes returns an array of all addresses saved in the discovery list\n\n```go\nfunc (di *DiscoveryImpl) GetRandomNodes(n int) []string\n```\nGetRandomNodes returns n random nodes\n\n```go\nfunc (di *DiscoveryImpl) RemoveNode(address string) bool\n```\nRemoveNode removes an address from the discovery list\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/discovery","name":"discovery","synopsis":"","isRedistributable":true}
