{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package discovery\n\n## Functions\n\n```go\nfunc NewService(config Config, sup Support) *service\n```\nNewService creates a new discovery service instance\n\n## Types\n\n```go\ntype AccessControlSupport interface {\n\t// Eligible returns whether the given peer is eligible for receiving\n\t// service from the discovery service for a given channel\n\tEligibleForService(channel string, data common2.SignedData) error\n}\n```\nAccessControlSupport checks if clients are eligible of being serviced\n\n```go\ntype Config struct {\n\tTLS                          bool\n\tAuthCacheEnabled             bool\n\tAuthCacheMaxSize             int\n\tAuthCachePurgeRetentionRatio float64\n}\n```\nConfig defines the configuration of the discovery service\n\n```go\nfunc (c Config) String() string\n```\nString returns a string representation of this Config\n\n```go\ntype ConfigSequenceSupport interface {\n\t// ConfigSequence returns the configuration sequence of the a given channel\n\tConfigSequence(channel string) uint64\n}\n```\nConfigSequenceSupport returns the config sequence of the given channel\n\n```go\ntype ConfigSupport interface {\n\t// Config returns the channel's configuration\n\tConfig(channel string) (*discprotos.ConfigResult, error)\n}\n```\nConfigSupport provides access to channel configuration\n\n```go\ntype EndorsementSupport interface {\n\t// PeersForEndorsement returns an EndorsementDescriptor for a given set of peers, channel, and chaincode\n\tPeersForEndorsement(channel common.ChainID, interest *discprotos.ChaincodeInterest) (*discprotos.EndorsementDescriptor, error)\n\n\t// PeersAuthorizedByCriteria returns the peers of the channel that are authorized by the given chaincode interest\n\t// That is - taking in account if the chaincode(s) in the interest are installed on the peers, and also\n\t// taking in account whether the peers are part of the collections of the chaincodes.\n\t// If a nil interest, or an empty interest is passed - no filtering is done.\n\tPeersAuthorizedByCriteria(chainID common.ChainID, interest *discprotos.ChaincodeInterest) (discovery.Members, error)\n}\n```\nEndorsementSupport provides knowledge of endorsement policy selection for chaincodes\n\n```go\ntype GossipSupport interface {\n\t// ChannelExists returns whether a given channel exists or not\n\tChannelExists(channel string) bool\n\n\t// PeersOfChannel returns the NetworkMembers considered alive\n\t// and also subscribed to the channel given\n\tPeersOfChannel(common.ChainID) discovery.Members\n\n\t// Peers returns the NetworkMembers considered alive\n\tPeers() discovery.Members\n\n\t// IdentityInfo returns identity information about peers\n\tIdentityInfo() api.PeerIdentitySet\n}\n```\nGossipSupport aggregates abilities that the gossip module provides to the discovery service, such as knowing information about peers\n\n```go\ntype Support interface {\n\tAccessControlSupport\n\tGossipSupport\n\tEndorsementSupport\n\tConfigSupport\n\tConfigSequenceSupport\n}\n```\nSupport defines an interface that allows the discovery service to obtain information that other peer components have\n\n","path":"github.com/eric-erki/https-hyperledger.org/discovery","name":"discovery","synopsis":"","isRedistributable":true}
