Documentation
¶
Index ¶
- type ChannelProviders
- type Client
- func (d *Client) Delete(ns, coll string, keys ...string) error
- func (d *Client) Get(ns, coll, key string) ([]byte, error)
- func (d *Client) GetMultipleKeys(ns, coll string, keys ...string) ([][]byte, error)
- func (d *Client) Put(ns, coll, key string, value []byte) error
- func (d *Client) PutMultipleValues(ns, coll string, kvs []*KeyValue) error
- func (d *Client) Query(ns, coll, query string) (commonledger.ResultsIterator, error)
- type KeyValue
- type OffLedger
- type PeerLedger
- type Provider
- type Providers
- type PvtDataDistributor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelProviders ¶ added in v0.1.1
type ChannelProviders struct { Ledger PeerLedger Distributor PvtDataDistributor ConfigRetriever support.CollectionConfigRetriever IdentityProvider collcommon.IdentityProvider }
ChannelProviders holds all of the providers required by the client
type Client ¶
type Client struct { *ChannelProviders // contains filtered or unexported fields }
Client allows you to put and get Client from outside of a chaincode
func New ¶
func New(channelID string, providers *ChannelProviders) *Client
New returns a new collection client
func (*Client) GetMultipleKeys ¶
GetMultipleKeys retrieves the values for the given keys
func (*Client) PutMultipleValues ¶
PutMultipleValues puts the given key/values
func (*Client) Query ¶
func (d *Client) Query(ns, coll, query string) (commonledger.ResultsIterator, error)
Query executes the given query and returns an iterator that contains results. Only used for state databases that support query. (Note that this function is not supported by transient data collections) The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult.
type OffLedger ¶ added in v0.1.1
type OffLedger interface { // Put puts the value for the given key Put(ns, coll, key string, value []byte) error // PutMultipleValues puts the given key/values PutMultipleValues(ns, coll string, kvs []*KeyValue) error // Delete deletes the given key(s) Delete(ns, coll string, keys ...string) error // Get retrieves the value for the given key Get(ns, coll, key string) ([]byte, error) // GetMultipleKeys retrieves the values for the given keys GetMultipleKeys(ns, coll string, keys ...string) ([][]byte, error) // Query executes the given query and returns an iterator that contains results. // Only used for state databases that support query. // The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult. Query(ns, coll, query string) (commonledger.ResultsIterator, error) }
OffLedger defines the functions of an off-ledger client
type PeerLedger ¶
type PeerLedger interface { // NewQueryExecutor gives handle to a query executor. // A client can obtain more than one 'QueryExecutor's for parallel execution. // Any synchronization should be performed at the implementation level if required NewQueryExecutor() (ledger.QueryExecutor, error) // NewTxSimulator gives handle to a transaction simulator. // A client can obtain more than one 'TxSimulator's for parallel execution. // Any snapshoting/synchronization should be performed at the implementation level if required NewTxSimulator(txid string) (ledger.TxSimulator, error) // GetBlockchainInfo returns basic info about blockchain GetBlockchainInfo() (*cb.BlockchainInfo, error) }
PeerLedger defines the ledger functions required by the client
type Provider ¶ added in v0.1.1
type Provider struct {
// contains filtered or unexported fields
}
Provider manages multiple clients - one per channel
func NewProvider ¶ added in v0.1.1
NewProvider returns a new client provider
type Providers ¶ added in v0.1.1
type Providers struct { LedgerProvider collcommon.LedgerProvider GossipProvider collcommon.GossipProvider ConfigProvider collcommon.CollectionConfigProvider IdentityProvider collcommon.IdentityProvider }
Providers contains all of the dependencies for the client
type PvtDataDistributor ¶ added in v0.1.1
type PvtDataDistributor interface {
DistributePrivateData(chainID string, txID string, privateData *transientstore.TxPvtReadWriteSetWithConfigInfo, blkHt uint64) error
}
PvtDataDistributor distributes private data to the peers in the collections according to policies induced by the PolicyStore and PolicyParser