cloudant_index

package
v0.0.0-...-aeb4a1d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJsonForFind

func GetJsonForFind(startKey string, endKey string, limit int, lastKey string) ([]byte, error)

func Init

func Init(stub cached_stub.CachedStubInterface, logLevel ...shim.LoggingLevel) ([]byte, error)

Init sets up the cloudant index package

Types

type CloudantIndexDatastoreImpl

type CloudantIndexDatastoreImpl struct {
	datastore.DatastoreInterface
	// contains filtered or unexported fields
}

Shell of cloudant impl. To be impl in different MR

func (CloudantIndexDatastoreImpl) GetIndex

func (ds CloudantIndexDatastoreImpl) GetIndex(stub cached_stub.CachedStubInterface, dataKey string, dataHash ...string) ([]byte, error)

func (CloudantIndexDatastoreImpl) GetIndexByRange

func (ds CloudantIndexDatastoreImpl) GetIndexByRange(stub cached_stub.CachedStubInterface, startKey string, endKey string, limit int, lastKey string) (shim.StateQueryIteratorInterface, error)

func (CloudantIndexDatastoreImpl) PutIndex

func (ds CloudantIndexDatastoreImpl) PutIndex(stub cached_stub.CachedStubInterface, dataKey string, encryptedData []byte) (string, error)

PutIndex writes index data to the store, and returns hash

type Docs

type Docs struct {
	Docs []cloudant.DbCloudantData `json:"docs"`
}

type IndexDatastoreInterface

type IndexDatastoreInterface interface {
	datastore.DatastoreInterface

	GetIndex(stub cached_stub.CachedStubInterface, dataKey string, dataHash ...string) ([]byte, error)

	GetIndexByRange(stub cached_stub.CachedStubInterface, startKey string, endKey string, limit int, lastKey string) (shim.StateQueryIteratorInterface, error)

	PutIndex(stub cached_stub.CachedStubInterface, dataKey string, encryptedData []byte) (string, error)
}

CachedStubInterface extends ChaincodeStubInterface

func GetIndexDatastoreImpl

func GetIndexDatastoreImpl(stub cached_stub.CachedStubInterface, datastoreConnectionID string) (IndexDatastoreInterface, error)

GetDatastoreImpl returns a new IndexDatastoreImpl instance that is initialized with DatastoreConnection identified by datastoreConnectionID. Caller should call this method once in a transaction and reuse the instance for data persistence.

type IndexIter

type IndexIter struct {
	FirstKey string //inclusive
	LastKey  string //exclusive
	Docs     []cloudant.DbCloudantData
	Current  int
	Closed   bool
}

func NewIndexIter

func NewIndexIter(startKey string, endKey string, docs Docs) (*IndexIter, error)

func (*IndexIter) Close

func (iIter *IndexIter) Close() error

func (*IndexIter) HasNext

func (iIter *IndexIter) HasNext() bool

func (*IndexIter) Next

func (iIter *IndexIter) Next() (*queryresult.KV, error)

Jump to

Keyboard shortcuts

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