{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cc\n\n## Variables\n\n```go\nvar (\n\t// Logger is the logging instance for this package.\n\t// It's exported because the tests override its backend\n\tLogger = flogging.MustGetLogger(\"discovery.lifecycle\")\n)\n```\n\n## Functions\n\n```go\nfunc DeployedChaincodes(q Query, filter ChaincodePredicate, loadCollections bool, chaincodes ...string) (chaincode.MetadataSet, error)\n```\nDeployedChaincodes retrieves the metadata of the given deployed chaincodes\n\n## Types\n\n```go\ntype ChaincodePredicate func(cc chaincode.Metadata) bool\n```\nChaincodePredicate accepts or rejects chaincode based on its metadata\n\n```go\nvar (\n\t// AcceptAll returns a predicate that accepts all Metadata\n\tAcceptAll ChaincodePredicate = func(cc chaincode.Metadata) bool {\n\t\treturn true\n\t}\n)\n```\n\n```go\ntype Enumerate func() ([]chaincode.InstalledChaincode, error)\n```\nEnumerate enumerates installed chaincodes\n\n```go\nfunc (listCCs Enumerate) Enumerate() ([]chaincode.InstalledChaincode, error)\n```\nEnumerate enumerates chaincodes\n\n```go\ntype Enumerator interface {\n\t// Enumerate returns the installed chaincodes\n\tEnumerate() ([]chaincode.InstalledChaincode, error)\n}\n```\nEnumerator enumerates chaincodes\n\n```go\ntype HandleMetadataUpdate func(channel string, chaincodes chaincode.MetadataSet)\n```\nHandleMetadataUpdate is triggered upon a change in the chaincode lifecycle change\n\n```go\nfunc (mdUpdate HandleMetadataUpdate) LifeCycleChangeListener(channel string, chaincodes chaincode.MetadataSet)\n```\nLifeCycleChangeListener runs whenever there is a change to the metadata // of a chaincode in the context of a specific channel\n\n```go\ntype LifeCycleChangeListener interface {\n\tLifeCycleChangeListener(channel string, chaincodes chaincode.MetadataSet)\n}\n```\nLifeCycleChangeListener runs whenever there is a change to the metadata of a chaincode in the context of a specific channel\n\n```go\ntype Lifecycle struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nLifecycle manages information regarding chaincode lifecycle\n\n```go\nfunc NewLifeCycle(installedChaincodes Enumerator) (*Lifecycle, error)\n```\nNewLifeCycle creates a new Lifecycle instance\n\n```go\nfunc (lc *Lifecycle) AddListener(listener LifeCycleChangeListener)\n```\nAddListener registers the given listener to be triggered upon a lifecycle change\n\n```go\nfunc (lc *Lifecycle) Metadata(channel string, cc string, collections bool) *chaincode.Metadata\n```\nMetadata returns the metadata of the chaincode on the given channel, or nil if not found or an error occurred at retrieving it\n\n```go\nfunc (lc *Lifecycle) NewChannelSubscription(channel string, queryCreator QueryCreator) (*Subscription, error)\n```\nNewChannelSubscription subscribes to a channel\n\n```go\ntype Query interface {\n\t// GetState gets the value for given namespace and key. For a chaincode, the namespace corresponds to the chaincodeId\n\tGetState(namespace string, key string) ([]byte, error)\n\n\t// Done releases resources occupied by the QueryExecutor\n\tDone()\n}\n```\nQuery queries the state\n\n```go\ntype QueryCreator interface {\n\t// NewQuery creates a new Query, or error on failure\n\tNewQuery() (Query, error)\n}\n```\nQueryCreator creates queries\n\n```go\ntype QueryCreatorFunc func() (Query, error)\n```\nQueryCreatorFunc creates a new query\n\n```go\nfunc (qc QueryCreatorFunc) NewQuery() (Query, error)\n```\nNewQuery creates a new Query, or error on failure\n\n```go\ntype Subscription struct {\n\tsync.Mutex\n\t// contains filtered or unexported fields\n}\n```\nSubscription channels information flow about a specific channel into the Lifecycle\n\n```go\nfunc (sub *Subscription) ChaincodeDeployDone(succeeded bool)\n```\nChaincodeDeployDone gets invoked when the chaincode deploy transaction or chaincode install (the context in which the above function was invoked)\n\n```go\nfunc (sub *Subscription) HandleChaincodeDeploy(chaincodeDefinition *cceventmgmt.ChaincodeDefinition, dbArtifactsTar []byte) error\n```\nHandleChaincodeDeploy is expected to be invoked when a chaincode is deployed via a deploy transaction and the chaicndoe was already installed on the peer. This also gets invoked when an already deployed chaincode is installed on the peer\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/cclifecycle","name":"cc","synopsis":"","isRedistributable":true}
