Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiSpec ¶
type ApiSpec interface {
// IsCrypto indicates whether the API request uses EC-crypto.
IsCrypto() bool
// SetCryptoKey adds crypto key in parameters.
SetCryptoKey(key string)
// Url returns the request URL of API.
Url() string
// Payload returns the request body of API.
Payload() Payload
// Parse parses the response body.
Parse(r io.Reader) (err error)
}
ApiSpec describes the specification of an 115 API.
type Client ¶
type Client interface {
// GetUserAgent returns current "User-Agent" value.
GetUserAgent() string
// ExportCookies exports cookies for specific URL.
ExportCookies(url string) map[string]string
// Get performs an HTTP GET request.
Get(url string, headers map[string]string, context context.Context) (body io.ReadCloser, err error)
// CallApi calls an API.
CallApi(spec ApiSpec, context context.Context) error
}
Client is the low-level client which executes ApiSpec.
Click to show internal directories.
Click to hide internal directories.