Documentation ¶
Index ¶
- Constants
- func AddHandler(cfg TicketConfig) addHandler
- func ApplyHandler(cfg TicketConfig) applyHandler
- func GeneralInvokingTemplate(ccname string, cfg TicketConfig) (ret tx.CollectiveTxs)
- func GeneralQueryTemplate(ccname string, cfg TicketConfig) (ret tx.CollectiveTxs)
- func QueryHandler(cfg TicketConfig) queryHandler
- type GeneralCall
- type InnerInvokeConfig
- type StandardTicketConfig
- type TicketConfig
- type TicketTx
Constants ¶
View Source
const ( Method_Add = "TICKET.UPDATE" Method_Apply = "TICKET.QUERY" Method_Query = "TICKET.CONTRACT" )
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func AddHandler(cfg TicketConfig) addHandler
func ApplyHandler ¶
func ApplyHandler(cfg TicketConfig) applyHandler
func GeneralInvokingTemplate ¶
func GeneralInvokingTemplate(ccname string, cfg TicketConfig) (ret tx.CollectiveTxs)
func GeneralQueryTemplate ¶
func GeneralQueryTemplate(ccname string, cfg TicketConfig) (ret tx.CollectiveTxs)
func QueryHandler ¶
func QueryHandler(cfg TicketConfig) queryHandler
Types ¶
type GeneralCall ¶
func (*GeneralCall) Add ¶
func (*GeneralCall) Apply ¶
func (i *GeneralCall) Apply(owner []byte, id []byte) error
type InnerInvokeConfig ¶
type InnerInvokeConfig struct {
txgen.InnerChaincode
}
func (InnerInvokeConfig) NewTx ¶
func (c InnerInvokeConfig) NewTx(stub shim.ChaincodeStubInterface, nc []byte) TicketTx
type StandardTicketConfig ¶
func NewConfig ¶
func NewConfig(tag string) *StandardTicketConfig
func (*StandardTicketConfig) NewTx ¶
func (cfg *StandardTicketConfig) NewTx(stub shim.ChaincodeStubInterface, nonce []byte) TicketTx
type TicketConfig ¶
type TicketConfig interface {
NewTx(shim.ChaincodeStubInterface, []byte) TicketTx
}
type TicketTx ¶
type TicketTx interface { //add an ticket belong to the owner, which MUST has an unique id, //or error will be returned if the id is duplicated //ticket catalogy MUST start from 1 (0 or less is not allowed) Add(owner []byte, id []byte, ticketCat int, desc string) error //check if the ticket with specified id existed (error is returned //if not) and remove it Apply(owner []byte, id []byte) error //query the desc and catalogy, a catalogy less than 0 indicate the //ticket is not exist Query(owner []byte, id []byte) (int, string) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.