Documentation ¶
Index ¶
- Variables
- type ContractData
- type ExtStore
- 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 Type
Constants ¶
This section is empty.
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 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 ExtStore) error
Add a new store to the router
func (StorageRouter) Get ¶ added in v0.14.3
func (s StorageRouter) Get(storeType Type) (ExtStore, error)
Get the structure of store ,using the Type
func (*StorageRouter) WithState ¶ added in v0.16.1
func (s *StorageRouter) WithState(state *storage.State) *StorageRouter