Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KVData ¶
type KVData struct { Collection string `json:"collection"` // optional Key string `json:"key"` // required Value string `json:"value"` // required for read, ignored for write }
KVData contains the data to read/write a key. Key is required. Value is required for write and ignored for read. When Collection is empty string "", it will read/write state data. When Collection is not empty string "", it will read/write private data in the collection.
type KVExecutor ¶
type KVExecutor struct{}
KVExecutor is a chaincode implementation that takes a KVData array as read parameter and a KVData array as write parameter, and then calls GetXXX/PutXXX methods to read and write state/collection data. Both input params should be marshalled json data and then base64 encoded.
func (*KVExecutor) Init ¶
func (t *KVExecutor) Init(stub shim.ChaincodeStubInterface) pb.Response
Init initializes chaincode ===========================
func (*KVExecutor) Invoke ¶
func (t *KVExecutor) Invoke(stub shim.ChaincodeStubInterface) pb.Response
Invoke - Our entry point for Invocations ========================================