Documentation ¶
Index ¶
- type ChaincodeStubWrapper
- func (s ChaincodeStubWrapper) Batch() (datastore.Batch, error)
- func (s ChaincodeStubWrapper) Close() error
- func (s ChaincodeStubWrapper) Delete(key datastore.Key) error
- func (s *ChaincodeStubWrapper) Get(key datastore.Key) ([]byte, error)
- func (s ChaincodeStubWrapper) GetSize(key datastore.Key) (int, error)
- func (s ChaincodeStubWrapper) Has(key datastore.Key) (bool, error)
- func (s *ChaincodeStubWrapper) Put(key datastore.Key, value []byte) error
- func (s ChaincodeStubWrapper) Query(q query.Query) (query.Results, error)
- func (s ChaincodeStubWrapper) Sync(prefix datastore.Key) error
- type OffLedgerClientWrapper
- func (s OffLedgerClientWrapper) Batch() (datastore.Batch, error)
- func (s OffLedgerClientWrapper) Close() error
- func (s OffLedgerClientWrapper) Delete(key datastore.Key) error
- func (s *OffLedgerClientWrapper) Get(key datastore.Key) ([]byte, error)
- func (s OffLedgerClientWrapper) GetSize(key datastore.Key) (int, error)
- func (s OffLedgerClientWrapper) Has(key datastore.Key) (bool, error)
- func (s *OffLedgerClientWrapper) Put(key datastore.Key, value []byte) error
- func (s OffLedgerClientWrapper) Query(q query.Query) (query.Results, error)
- func (s OffLedgerClientWrapper) Sync(prefix datastore.Key) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChaincodeStubWrapper ¶
type ChaincodeStubWrapper struct {
// contains filtered or unexported fields
}
ChaincodeStubWrapper implements the github.com/ipfs/go-datastore.Batching interface. This implementation uses a chaincode stub to store and retrieve data.
func NewStubWrapper ¶
func NewStubWrapper(coll string, stub shim.ChaincodeStubInterface) *ChaincodeStubWrapper
NewStubWrapper returns a stub-wrapping IPFS data store
func (ChaincodeStubWrapper) Batch ¶
func (s ChaincodeStubWrapper) Batch() (datastore.Batch, error)
Batch is not supported
func (ChaincodeStubWrapper) Delete ¶
func (s ChaincodeStubWrapper) Delete(key datastore.Key) error
Delete removes the value for given `key`. Note: This function is never called for the DCAS so we'll leave it unimplemented. If it is ever called in the future then an implementation will need to be provided.
func (*ChaincodeStubWrapper) Get ¶
func (s *ChaincodeStubWrapper) Get(key datastore.Key) ([]byte, error)
Get retrieves the object `value` named by `key`. Get will return ErrNotFound if the key is not mapped to a value.
func (ChaincodeStubWrapper) GetSize ¶
GetSize returns the size of the `value` named by `key`. Note: This function is never called for the DCAS so we'll leave it unimplemented. If it is ever called in the future then an implementation will need to be provided.
func (ChaincodeStubWrapper) Has ¶
Has returns whether the `key` is mapped to a `value`. This function is only called just before a Put is called. It is cheaper to always return false and let the 'Put' go through than to ask for the data from other peers before each Put.
func (*ChaincodeStubWrapper) Put ¶
func (s *ChaincodeStubWrapper) Put(key datastore.Key, value []byte) error
Put stores the object `value` named by `key`.
type OffLedgerClientWrapper ¶
type OffLedgerClientWrapper struct {
// contains filtered or unexported fields
}
OffLedgerClientWrapper implements the github.com/ipfs/go-datastore.Batching interface. This implementation uses an off-ledger client to store and retrieve data.
func NewOLClientWrapper ¶
func NewOLClientWrapper(ns, coll string, olclient client.OffLedger) *OffLedgerClientWrapper
NewOLClientWrapper returns an off-ledger client-wrapping IPFS data store
func (OffLedgerClientWrapper) Batch ¶
func (s OffLedgerClientWrapper) Batch() (datastore.Batch, error)
Batch is not supported
func (OffLedgerClientWrapper) Close ¶
func (s OffLedgerClientWrapper) Close() error
Close does nothing
func (OffLedgerClientWrapper) Delete ¶
func (s OffLedgerClientWrapper) Delete(key datastore.Key) error
Delete removes the value for given `key`. Note: This function is never called for the DCAS so we'll leave it unimplemented. If it is ever called in the future then an implementation will need to be provided.
func (*OffLedgerClientWrapper) Get ¶
func (s *OffLedgerClientWrapper) Get(key datastore.Key) ([]byte, error)
Get retrieves the object `value` named by `key`. Get will return ErrNotFound if the key is not mapped to a value.
func (OffLedgerClientWrapper) GetSize ¶
GetSize returns the size of the `value` named by `key`. Note: This function is never called for the DCAS so we'll leave it unimplemented. If it is ever called in the future then an implementation will need to be provided.
func (OffLedgerClientWrapper) Has ¶
Has returns whether the `key` is mapped to a `value`. This function is only called just before a Put is called. It is cheaper to always return false and let the 'Put' go through than to ask for the data from other peers before each Put.
func (*OffLedgerClientWrapper) Put ¶
func (s *OffLedgerClientWrapper) Put(key datastore.Key, value []byte) error
Put stores the object `value` named by `key`.