Documentation ¶
Index ¶
- Variables
- type AccountSgx
- type ApiClient
- type ApiClientXuperchain
- func (c *ApiClientXuperchain) Create(method string, args map[string]interface{}) (*Response, error)
- func (c *ApiClientXuperchain) IsExist(method string, args map[string]interface{}) (*Response, error)
- func (c *ApiClientXuperchain) Ping(method string, args map[string]interface{}) (*Response, error)
- func (c *ApiClientXuperchain) Sign(method string, args map[string]interface{}) (*Response, error)
- func (c *ApiClientXuperchain) Verify(method string, args map[string]interface{}) (*Response, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Ping = "/ping" Create = "/create" Sign = "/sign" Verify = "/verify" IsExist = "/is-exist" PingMethod = "GET" CreateMethod = "GET" SignMethod = "POST" VerifyMethod = "POST" IsExistMethod = "POST" )
test方便测试 (后期通过配置文件/填写参数形式)
Functions ¶
This section is empty.
Types ¶
type AccountSgx ¶
type AccountSgx struct { // 钱包地址 Address string // api client APISgx ApiClient // contains filtered or unexported fields }
func (*AccountSgx) GetAuthRequire ¶
func (a *AccountSgx) GetAuthRequire() string
GetAuthRequire get this account's authRequire for transaction. If you set contract account, returns $ContractAccount+"/"+$Address, otherwise returns $Address.
func (*AccountSgx) GetContractAccount ¶
func (a *AccountSgx) GetContractAccount() string
GetContractAccount get current contract account, returns an empty string if the contract account is not set.
func (*AccountSgx) HasContractAccount ¶
func (a *AccountSgx) HasContractAccount() bool
HasContractAccount reutrn true if you set contract account, otherwise returns false.
func (*AccountSgx) SetContractAccount ¶
func (a *AccountSgx) SetContractAccount(contractAccount string) error
SetContractAccount set contract account. If you set contract account, this account represents the contract account. In some scenarios, must set contract account, such as deploy contract.
type ApiClient ¶
type ApiClient interface { Ping(method string, args map[string]interface{}) (*Response, error) Create(method string, args map[string]interface{}) (*Response, error) Sign(method string, args map[string]interface{}) (*Response, error) Verify(method string, args map[string]interface{}) (*Response, error) IsExist(method string, args map[string]interface{}) (*Response, error) }
通过接口提供相关服务
func NewApiClientXuperchain ¶
type ApiClientXuperchain ¶
type ApiClientXuperchain struct {
URL string // 服务地址
}
封装请求api服务的结构体
func (*ApiClientXuperchain) Create ¶
func (c *ApiClientXuperchain) Create(method string, args map[string]interface{}) (*Response, error)
func (*ApiClientXuperchain) IsExist ¶
func (c *ApiClientXuperchain) IsExist(method string, args map[string]interface{}) (*Response, error)
func (*ApiClientXuperchain) Ping ¶
func (c *ApiClientXuperchain) Ping(method string, args map[string]interface{}) (*Response, error)
Click to show internal directories.
Click to hide internal directories.