datastore_i

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDatastoreConnection

func DeleteDatastoreConnection(stub cached_stub.CachedStubInterface,
	caller data_model.User,
	datastoreConnectionID string) error

DeleteDatastoreConnection deletes a DatastoreConnection from the Ledger. If the datastoreConnectionID does not exist on the Ledger, it does nothing. Caller must have an app admin role to use this method.

func GetDatastoreConnection

func GetDatastoreConnection(stub cached_stub.CachedStubInterface, datastoreConnectionID string) (datastore.DatastoreConnection, error)

GetDatastoreConnection returns DatastoreConnection from the ledger

func GetDatastoreImpl

func GetDatastoreImpl(stub cached_stub.CachedStubInterface, datastoreConnectionID string) (datastore.DatastoreInterface, error)

GetDatastoreImpl returns a new DatastoreImpl 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.

func Init

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

Init sets up the datastore package by adding default ledger connection.

func InitDefaultDatastore

func InitDefaultDatastore(stub cached_stub.CachedStubInterface, args ...string) ([]byte, error)

InitDefaultDatastore sets up the default off-chain Cloudant datastore.

func IsRegisteredDatastoreType

func IsRegisteredDatastoreType(datastoreType string) bool

IsRegisteredDatastoreType returns true if the datastore type is one of the default ones or registered via RegisterDatastoreImpl method

func PutDatastoreConnection

func PutDatastoreConnection(stub cached_stub.CachedStubInterface,
	caller data_model.User,
	datastoreConnection datastore.DatastoreConnection) error

PutDatastoreConnection puts a DatastoreConnection on the Ledger (encrypted). Validates that Datastore Type must be either default ones or registered via RegisterDatastoreImpl method

func RegisterDatastoreImpl

func RegisterDatastoreImpl(caller data_model.User, datastoreType string, implementation datastore.DatastoreInterface) error

RegisterDatastoreImpl is used by Solution to register a new Datastore Type. If default off-chain storage implementation is sufficient for your use case, there is no need to use this method.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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