Documentation
¶
Index ¶
- Constants
- Variables
- type ContractData
- type OLVMContext
- type OLVMRequest
- type OLVMResult
- type Request
- func (r *Request) ClientDeserialize(name string, obj interface{}) error
- func (r *Request) GetBool(key string) (bool, error)
- func (r *Request) GetBytes(key string) []byte
- func (r *Request) GetFloat64(key string) float64
- func (r *Request) GetInt(key string) int
- func (r *Request) GetString(key string) string
- func (r *Request) Parse()
- type Response
- type Router
- type StorageRouter
- type TransactionData
- type Type
Constants ¶
const ( TagOLVMResult = "action_olvm_result" TagOLVMRequest = "action_olvm_request" TagOLVMContext = "action_olvm_context" )
Variables ¶
var ( ErrParamNotFound = errors.New("param not found") ErrWrongParamType = errors.New("wrong param type") )
Functions ¶
This section is empty.
Types ¶
type ContractData ¶
func NewContractData ¶
func NewContractData(address []byte) *ContractData
NewContractData returns a pointer to a new ContractData object. It takes an address as an input.
func (*ContractData) Get ¶
func (data *ContractData) Get(key string) interface{}
func (*ContractData) Update ¶
func (data *ContractData) Update(d map[string]interface{}) error
func (*ContractData) UpdateByJSONData ¶
func (data *ContractData) UpdateByJSONData(in []byte) error
func (*ContractData) Validate ¶
func (data *ContractData) Validate(address []byte) bool
type OLVMContext ¶
type OLVMContext struct {
Data map[string]interface{}
}
func (OLVMContext) GetValue ¶
func (context OLVMContext) GetValue(key string) interface{}
type OLVMRequest ¶
type OLVMRequest struct { From string Address string CallString string Value int SourceCode []byte Reference []byte Transaction TransactionData Context OLVMContext }
All of the input necessary to perform a computation on a transaction
func NewOLVMRequest ¶
func NewOLVMRequest(script []byte, context OLVMContext) *OLVMRequest
func NewOLVMResultWithCallString ¶
func NewOLVMResultWithCallString(script []byte, callString string, context OLVMContext) *OLVMRequest
type OLVMResult ¶
type OLVMResult struct { Status string Out string Ret string // TODO: Should be a real name Elapsed string Reference []byte Transactions []TransactionData Context OLVMContext }
All of the output received from the computation
func NewOLVMResult ¶
func NewOLVMResult() *OLVMResult
type Request ¶
type Request struct { Query string // the query method Data []byte // data stored as a serialized byte array Params map[string]interface{} // request params as a map of string to interface }
Request
Request generic request object for Query handling. Request comes with its query string and parameters
func NewRequest ¶
NewRequest creates a new request with given BTCParams.
func NewRequestFromData ¶
NewRequestFromData creates a new request object from a byte array
func NewRequestFromObj ¶
NewRequestFromObj creates a new request object from an arguments struct passed. It serializes the argument struct object for a client channel and sets it against an argname. You can check example argument structs in client/request.
func (*Request) ClientDeserialize ¶
func (*Request) GetFloat64 ¶
type Response ¶
type Response struct { Data []byte `json:"data"` ErrorMsg string `json:"errorMsg,omitempty"` Success bool `json:"success"` }
Response
func (*Response) SetDataObj ¶
type Router ¶ added in v0.14.3
Router interface supplies functionality to add a store to the Data package.
type StorageRouter ¶ added in v0.14.3
type StorageRouter struct {
// contains filtered or unexported fields
}
func NewStorageRouter ¶ added in v0.14.3
func NewStorageRouter() StorageRouter
func (StorageRouter) Add ¶ added in v0.14.3
func (s StorageRouter) Add(storeType Type, storeObj interface{}) error
Add a new store to the router
func (StorageRouter) Get ¶ added in v0.14.3
func (s StorageRouter) Get(storeType Type) (interface{}, error)
Get the structure of store ,using the Type
type TransactionData ¶
type TransactionData []byte