Documentation ¶
Index ¶
- Variables
- func Exists(stub shim.ChaincodeStubInterface, key interface{}) (exists bool, err error)
- func Get(stub shim.ChaincodeStubInterface, key interface{}, target ...interface{}) (result interface{}, err error)
- func Insert(stub shim.ChaincodeStubInterface, key interface{}, values ...interface{}) (err error)
- func InvokeChaincode(stub shim.ChaincodeStubInterface, chaincodeName string, args []interface{}, ...) (interface{}, error)
- func Key(stub shim.ChaincodeStubInterface, key interface{}) (string, error)
- func KeyParts(key interface{}) ([]string, error)
- func Put(stub shim.ChaincodeStubInterface, key interface{}, values ...interface{}) (err error)
- type EntryList
- type Keyer
- type KeyerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnableToCreateKey can occurs while creating composite key for entry ErrUnableToCreateKey = errors.New(`unable to create state key`) // ErrKeyAlreadyExists can occurs when trying to insert entry with existing key ErrKeyAlreadyExists = errors.New(`state key already exists`) // ErrAllowOnlyOneValue can occurs when trying to call Insert or Put with more than 2 arguments ErrAllowOnlyOneValue = errors.New(`allow only one value`) // ErrKeyNotSupportKeyerInterface can occurs when trying to Insert or Put struct without providing key and struct not support Keyer interface ErrKeyNotSupportKeyerInterface = errors.New(`key not support keyer interface`) // ErrKeyPartsLength can occurs when trying to create key consisting of zero parts ErrKeyPartsLength = errors.New(`key parts length must be greater than zero`) )
View Source
var (
ErrEmptyChaincodeResponsePayload = errors.New(`empty chaincode response payload`)
)
Functions ¶
func Exists ¶
func Exists(stub shim.ChaincodeStubInterface, key interface{}) (exists bool, err error)
Exists check entry with key exists in chaincode state
func Get ¶
func Get(stub shim.ChaincodeStubInterface, key interface{}, target ...interface{}) (result interface{}, err error)
Get data by key from state, trying to convert to target interface
func Insert ¶
func Insert(stub shim.ChaincodeStubInterface, key interface{}, values ...interface{}) (err error)
Insert value into chaincode state, returns error if key already exists
func InvokeChaincode ¶
func InvokeChaincode( stub shim.ChaincodeStubInterface, chaincodeName string, args []interface{}, channel string, target interface{}) (interface{}, error)
InvokeChaincode locally calls the specified chaincode and converts result into target data type
func Key ¶
func Key(stub shim.ChaincodeStubInterface, key interface{}) (string, error)
Key transforms interface{} to string key
func Put ¶
func Put(stub shim.ChaincodeStubInterface, key interface{}, values ...interface{}) (err error)
Put data value in state with key, trying convert data to []byte
Types ¶
type EntryList ¶
type EntryList []interface{}
EntryList list of entries from state, gotten by part of composite key
type Keyer ¶
Keyer interface for entity containing logic of its key creation
func StringKeyer ¶
StringKeyer constructor for struct implementing Keyer interface
Click to show internal directories.
Click to hide internal directories.