Documentation
¶
Overview ¶
Miscellaneous provider-related SDKs.
Index ¶
- type Client
- type Request
- type ZBox
- func (z *ZBox) BuildUrls(baseURLs []string, queryString map[string]string, pathFormat string, ...) []string
- func (z *ZBox) CreateTransport() *http.Transport
- func (z *ZBox) DoPost(req *Request, handle resty.Handle) *resty.Resty
- func (z *ZBox) InitWallet(js string) error
- func (z *ZBox) SignRequest(req *http.Request, allocationID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶ added in v1.7.3
type Request struct {
//AllocationID optional. allocation id
AllocationID string
//ConnectionID optional. session id
ConnectionID string
// ContentType content-type in header
ContentType string
// Body form data
Body io.Reader
// QueryString query string
QueryString map[string]string
}
Request request payload
type ZBox ¶
type ZBox struct {
// ClientID client id
ClientID string
// ClientKey client key
ClientKey string
// SignatureScheme signature scheme
SignatureScheme string
// Wallet wallet
Wallet *zcncrypto.Wallet
// NewRequest create http request
NewRequest func(method, url string, body io.Reader) (*http.Request, error)
}
ZBox sdk client instance
func New ¶
New create an sdk client instance given its configuration
- clientID client id of the using client
- clientKey client key of the using client
- signatureScheme signature scheme for transaction encryption
- wallet wallet of the using client
func (*ZBox) BuildUrls ¶ added in v1.7.3
func (z *ZBox) BuildUrls(baseURLs []string, queryString map[string]string, pathFormat string, pathArgs ...interface{}) []string
BuildUrls build full request url given base urls, query string, path format and path args
- baseURLs base urls
- queryString query string
- pathFormat path format
- pathArgs path args
func (*ZBox) CreateTransport ¶ added in v1.7.3
CreateTransport create http.Transport with default dial timeout
func (*ZBox) DoPost ¶ added in v1.7.3
DoPost do post request with request and handle
- req request instance
- handle handle function for the response
Click to show internal directories.
Click to hide internal directories.