Documentation ¶
Index ¶
- func HmacSha256(data, key string) string
- func Timestamp() string
- type Client
- func (c *Client) Do(r *http.Request) (res *http.Response, err error)
- func (c *Client) DoAndParse(r Request, resp interface{}) (err error)
- func (c *Client) Parse(res *http.Response, resp interface{}) error
- func (c *Client) PlainSign(timestamp string) string
- func (c *Client) Request(r Request) (req *http.Request, err error)
- func (c *Client) Token() (token string, err error)
- func (c *Client) TokenSign(token, timestamp string) string
- type Endpoint
- type Error
- type HTTPClient
- type MemoryStore
- type Option
- type Request
- type RequestBody
- type Response
- type TokenRequest
- type TokenResponse
- type TokenStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DoAndParse ¶
type Endpoint ¶
type Endpoint string
const ( // APIEndpointCN prefer to China. APIEndpointCN Endpoint = "https://openapi.tuyacn.com" // APIEndpointUS prefer to America. APIEndpointUS Endpoint = "https://openapi.tuyaus.com" // APIEndpointEU prefer to Europe. APIEndpointEU Endpoint = "https://openapi.tuyaeu.com" // APIEndpointIN prefer to India. APIEndpointIN Endpoint = "https://openapi.tuyain.com" )
type HTTPClient ¶
HTTPClient interface.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func (*MemoryStore) Refresh ¶
func (s *MemoryStore) Refresh(c *Client) (err error)
func (*MemoryStore) Token ¶
func (s *MemoryStore) Token() string
type Option ¶
type Option func(o *options)
func WithTokenStore ¶
func WithTokenStore(s TokenStorage) Option
WithTokenStore setup token storage interface.
type RequestBody ¶
type RequestBody interface {
Body() interface{}
}
type TokenRequest ¶
type TokenRequest struct {
// contains filtered or unexported fields
}
func (*TokenRequest) Method ¶
func (t *TokenRequest) Method() string
func (*TokenRequest) SetRefresh ¶
func (t *TokenRequest) SetRefresh(token string)
func (*TokenRequest) URL ¶ added in v0.1.1
func (t *TokenRequest) URL() string
type TokenResponse ¶
type TokenStorage ¶
TokenStorage stores token.
Directories ¶
Path | Synopsis |
---|---|
Package automation for scene automation.
|
Package automation for scene automation. |
catalog
|
|
bodyfat
Package bodyfat for Body Fat Scale
|
Package bodyfat for Body Fat Scale |
infrared
Package infrared for Universal Infrared
|
Package infrared for Universal Infrared |
ipc
Package ipc for IPC
|
Package ipc for IPC |
sleep
Package sleep for Sleep pace
|
Package sleep for Sleep pace |
smartlock
Package smartlock for Smart Door Lock interface.
|
Package smartlock for Smart Door Lock interface. |
Package data for Data Service.
|
Package data for Data Service. |
Package device implements Device Management API interface.
|
Package device implements Device Management API interface. |
Package devicectl for Device Control
|
Package devicectl for Device Control |
Package group for Device Group
|
Package group for Device Group |
Package ota for OTA upgrade.
|
Package ota for OTA upgrade. |
Package pairing for Device Pairing.
|
Package pairing for Device Pairing. |
Package smarthome for Smart Home Management
|
Package smarthome for Smart Home Management |
helpers
Package helpers is a generated GoMock package.
|
Package helpers is a generated GoMock package. |
Package timing for Device Timing Management
|
Package timing for Device Timing Management |
Package user for User Management
|
Package user for User Management |
Package weather for Weather Service.
|
Package weather for Weather Service. |
Click to show internal directories.
Click to hide internal directories.