ipfsdatastore

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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) Close

func (s ChaincodeStubWrapper) Close() error

Close does nothing

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

func (s ChaincodeStubWrapper) GetSize(key datastore.Key) (int, error)

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

func (s ChaincodeStubWrapper) Has(key datastore.Key) (bool, error)

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`.

func (ChaincodeStubWrapper) Query

func (s ChaincodeStubWrapper) Query(q query.Query) (query.Results, error)

Query searches the datastore and returns a query result. 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) Sync

func (s ChaincodeStubWrapper) Sync(prefix datastore.Key) error

Sync does nothing.

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

func (s OffLedgerClientWrapper) GetSize(key datastore.Key) (int, error)

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

func (s OffLedgerClientWrapper) Has(key datastore.Key) (bool, error)

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`.

func (OffLedgerClientWrapper) Query

func (s OffLedgerClientWrapper) Query(q query.Query) (query.Results, error)

Query searches the datastore and returns a query result. 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) Sync

func (s OffLedgerClientWrapper) Sync(prefix datastore.Key) error

Sync does nothing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL