Documentation ¶
Index ¶
- Constants
- func Lint(v interface{}, c interface{}) string
- type Account
- type AccountResponse
- type Accounts
- type AccountsResponse
- type Client
- func (c *Client) AppendIss(ia *tsiss.IssAppend) (*tsiss.IssAppendResponse, error)
- func (c *Client) GetAccounts(u *Accounts, common *Common) (*AccountsResponse, error)
- func (c *Client) GetAddrByPubkey() []byte
- func (c *Client) GetIssSignStr(ia *tsiss.IssAppend) (string, error)
- func (c *Client) GetPrivateKey() string
- func (c *Client) GetPubkeyOfAccount(u *PubkeyOfAccount, common *Common) (*PubkeyOfAccountResponse, error)
- func (c *Client) GetPublicKey() string
- func (c *Client) GetUserInfo(u *UserInfo, common *Common) (*UserInfoResponse, error)
- func (c *Client) QueryIss(iq *tsiss.IssQuery) (*tsiss.IssResponse, error)
- func (c *Client) RegisteAccount(u *Account, common *Common) (*AccountResponse, error)
- func (c *Client) RegisteUser(u *UserRegister, common *Common) (*UserRegisterResponse, error)
- func (c *Client) SetAppendIssURI(appendIssURI string)
- func (c *Client) SetGetAccountsURI(getAccountsURI string)
- func (c *Client) SetGetPubkeyOfAccountURI(getPubkeyOfAccountURI string)
- func (c *Client) SetGetUserInfoURI(getUserInfoURI string)
- func (c *Client) SetIssRequestTimeout(timeout time.Duration)
- func (c *Client) SetQueryIssURI(queryIssURI string)
- func (c *Client) SetRegisteAccountURI(registeAccountURI string)
- func (c *Client) SetRegisteUserURI(registeUserURI string)
- func (c *Client) SignString(s string, isHash bool) string
- func (c *Client) VerifySignature(sig, data []byte) bool
- type Common
- type PubkeyOfAccount
- type PubkeyOfAccountResponse
- type UserInfo
- type UserInfoResponse
- type UserRegister
- type UserRegisterResponse
Constants ¶
const ( AppendIssURI = "https://baas.trustsql.qq.com/cgi-bin/v1.0/trustsql_iss_append_v1.cgi" // 共享信息查询 QueryIssURI = "https://baas.trustsql.qq.com/cgi-bin/v1.0/trustsql_iss_query_v1.cgi" // 共享信息查询 RegisteUserURI = "https://baas.trustsql.qq.com/idm_v1.1/api/user_cert/register" // 注册用户 GetUserInfoURI = "https://baas.trustsql.qq.com/idm_v1.1/api/user_cert/fetch" // 获取用户信息 RegisteAccountURI = "https://baas.trustsql.qq.com/idm_v1.1/api/account_cert/register" // 创建用户账户 GetAccountsURI = "https://baas.trustsql.qq.com/idm_v1.1/api/account_cert/fetch_list" // 获取用户的账户地址列表 GetPubkeyOfAccountURI = "https://baas.trustsql.qq.com/idm_v1.1/api/account_cert/fetch" // 获取用户的账户公钥 )
trustsql URI 地址
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { UserID string `json:"user_id" validate:"required"` PublicKey string `json:"public_key" validate:"required"` }
Account 创建用户账户参数
type AccountResponse ¶
type AccountResponse struct { UserID string `json:"user_id"` // 用户ID AccountAddress string `json:"account_address"` // 创建的账户地址 PublicKey string `json:"public_key"` // 用户公钥 Created string `json:"created"` // 创建时间 State string `json:"state"` // 状态 }
AccountResponse 创建用户账户返回值
type Accounts ¶
type Accounts struct { UserID string `json:"user_id" validate:"required"` State string `json:"state" validate:"omitempty"` BeginTime string `json:"begin_time" validate:"omitempty"` EndTime string `json:"end_time" validate:"omitempty"` Page int `json:"page" validate:"omitempty"` Limit int `json:"limit" validate:"omitempty"` }
Accounts 获取用户的账户地址列表参数
type AccountsResponse ¶
type AccountsResponse struct { UserID string `json:"user_id"` // 用户ID AccountAddress string `json:"account_address"` // 创建的账户地址 PublicKey string `json:"public_key"` // 用户公钥 Created string `json:"created"` // 创建时间 State string `json:"state"` // 状态 }
AccountsResponse 获取用户的账户地址列表返回值
type Client ¶
Client 腾讯区块链sdk
func (*Client) GetAccounts ¶
func (c *Client) GetAccounts(u *Accounts, common *Common) (*AccountsResponse, error)
GetAccounts 获取用户的账户地址列表
func (*Client) GetAddrByPubkey ¶
GetAddrByPubkey 计算公钥对应的地址
func (*Client) GetIssSignStr ¶
GetIssSignStr 共享信息新增/追加, 第一步获取待签名串 注意: 留空sign字段
func (*Client) GetPubkeyOfAccount ¶
func (c *Client) GetPubkeyOfAccount(u *PubkeyOfAccount, common *Common) (*PubkeyOfAccountResponse, error)
GetPubkeyOfAccount 获取用户的账户公钥
func (*Client) GetUserInfo ¶
func (c *Client) GetUserInfo(u *UserInfo, common *Common) (*UserInfoResponse, error)
GetUserInfo 获取用户信息参数
func (*Client) RegisteAccount ¶
func (c *Client) RegisteAccount(u *Account, common *Common) (*AccountResponse, error)
RegisteAccount 创建用户账户
func (*Client) RegisteUser ¶
func (c *Client) RegisteUser(u *UserRegister, common *Common) (*UserRegisterResponse, error)
RegisteUser 注册用户
func (*Client) SetAppendIssURI ¶
SetAppendIssURI 设置URI
func (*Client) SetGetAccountsURI ¶
SetGetAccountsURI 设置URI
func (*Client) SetGetPubkeyOfAccountURI ¶
SetGetPubkeyOfAccountURI 设置URI
func (*Client) SetGetUserInfoURI ¶
SetGetUserInfoURI 设置URI
func (*Client) SetIssRequestTimeout ¶
SetIssRequestTimeout 设置Iss的请求超时时间
func (*Client) SetQueryIssURI ¶
SetQueryIssURI 设置URI
func (*Client) SetRegisteAccountURI ¶
SetRegisteAccountURI 设置URI
func (*Client) SetRegisteUserURI ¶
SetRegisteUserURI 设置URI
func (*Client) SignString ¶
SignString 对一个字符串进行签名(通常用于生成通讯方签名)
func (*Client) VerifySignature ¶
VerifySignature 对签名进行验证
type Common ¶
type Common struct { MchID string `json:"mch_id" validate:"required"` ProductCode string `json:"product_code" validate:"required"` SeqNo string `json:"seq_no" validate:"required"` Sign string `json:"sign" validate:"required"` Type string `json:"type" validate:"required"` TimeStamp int64 `json:"time_stamp" validate:"required"` ReqData string `json:"req_data" validate:"required"` }
Common 公共信息
type PubkeyOfAccount ¶
type PubkeyOfAccount struct { UserID string `json:"user_id" validate:"required"` AccountAddress string `json:"account_address" validate:"required"` }
PubkeyOfAccount 获取用户的账户公钥参数
type PubkeyOfAccountResponse ¶
type PubkeyOfAccountResponse struct { UserID string `json:"user_id"` // 用户ID AccountAddress string `json:"account_address"` // 创建的账户地址 PublicKey string `json:"public_key"` // 用户公钥 Created string `json:"created"` // 创建时间 State string `json:"state"` // 状态 }
PubkeyOfAccountResponse 获取用户的账户公钥返回值
type UserInfo ¶
type UserInfo struct {
UserID string `json:"user_id" validate:"required"`
}
UserInfo 获取用户信息参数
type UserInfoResponse ¶
type UserInfoResponse struct { UserID string `json:"user_id"` // 用户ID PublicKey string `json:"public_key"` // 用户公钥 UserAddress string `json:"user_address"` // 用户密钥地址 Created string `json:"created"` // 创建时间 State string `json:"state"` // 状态 }
UserInfoResponse 获取用户信息返回值
type UserRegister ¶
type UserRegister struct { PublicKey string `json:"public_key" validate:"required"` UserID string `json:"user_id" validate:"required"` UserFullName string `json:"user_fullName" validate:"required"` }
UserRegister 注册用户需要的信息
type UserRegisterResponse ¶
type UserRegisterResponse struct { UserID string `json:"user_id"` // 用户ID PublicKey string `json:"public_key"` // 用户公钥 UserAddress string `json:"user_address"` // 用户密钥地址 UserFullName string `json:"user_fullName"` // 用户名 Created string `json:"created"` // 创建时间 State string `json:"state"` // 状态 }
UserRegisterResponse 注册用户返回信息