Documentation
¶
Index ¶
- func NewContext(stub shim.ChaincodeStubInterface) *context
- type Chaincode
- type Context
- type ContextHandlerFunc
- type Group
- func (g *Group) Context(stub shim.ChaincodeStubInterface) Context
- func (g *Group) Group(path string) *Group
- func (g *Group) Handle(stub shim.ChaincodeStubInterface) peer.Response
- func (g *Group) HandleInit(stub shim.ChaincodeStubInterface) peer.Response
- func (g *Group) Init(handler HandlerFunc) *Group
- func (g *Group) Invoke(path string, handler HandlerFunc, requestValidate interface{}) *Group
- func (g *Group) Query(path string, handler HandlerFunc, requestValidate interface{}) *Group
- type HandlerFunc
- type HandlerMeta
- type MethodType
- type RequestMiddleware
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(stub shim.ChaincodeStubInterface) *context
Types ¶
type Chaincode ¶
type Chaincode struct {
// contains filtered or unexported fields
}
func NewChaincode ¶
type Context ¶
type Context interface {
Stub() shim.ChaincodeStubInterface
Request() interface{}
Path() string
GetArgs() [][]byte
SetHandler(*HandlerMeta)
ReplaceArgs(args [][]byte) Context
RequestArgs(interface{}) error
FirstArgs() []byte
GetStateByKey(string, string) ([]byte, error)
PutStateByKey(string, string, []byte) error
DelStateByKey(string, string) error
PutStateByIndex(string, string, []byte, string, []string) error
PutStateByCompositeKey(string, []string) error
DelStateByCompositeKey(string, []string) error
TimeUnixAndTx() (int64, string, error)
// Json Response
JSON(constant.ApiResult) (interface{}, error)
}
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
v0.1.0 OSP
func (*Group) HandleInit ¶
func (g *Group) HandleInit(stub shim.ChaincodeStubInterface) peer.Response
func (*Group) Init ¶
func (g *Group) Init(handler HandlerFunc) *Group
type HandlerMeta ¶
type HandlerMeta struct {
Hdl HandlerFunc
Type MethodType
ReqValidate interface{}
}
v0.1.0 OSP
type Router ¶
type Router interface {
HandleInit(stubInterface shim.ChaincodeStubInterface)
Handle(stubInterface shim.ChaincodeStubInterface)
Query(path string, handle HandlerFunc, middleware ...RequestMiddleware) Router
Invoke(path string, handle HandlerFunc, middleware ...RequestMiddleware) Router
}
v0.1.0 OSP
Click to show internal directories.
Click to hide internal directories.