Documentation
¶
Index ¶
- type API
- func (api API) CheckUser(userSign string) (*http.Response, error)
- func (api API) Do(request *http.Request) (response *http.Response, err error)
- func (api API) GET(uri string, payload map[string]interface{}) (*http.Response, error)
- func (api *API) GetToken(domain, login, password string) (err error)
- func (api API) POST(uri string, payload map[string]interface{}) (*http.Response, error)
- func (api API) SaveToken(filename string) error
- func (api *API) SetCustomClient(c *http.Client)
- func (api *API) SetEmbeddedApplication(appuuid, appsecret string)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API - Структура объекта API v1
func (*API) SetCustomClient ¶ added in v1.3.1
SetCustomClient - установить свой http.Client для API
func (*API) SetEmbeddedApplication ¶ added in v1.2.1
SetEmbeddedApplication - установить ключ от встроенного приложения
type Response ¶ added in v1.3.1
type Response struct {
Status struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"status"`
Data interface{} `json:"data"`
}
Response - структура стандартного ответа API
func ExpectedResponse ¶ added in v1.3.1
func ExpectedResponse(data interface{}) *Response
ExpectedResponse - оборачивает ожидаемый ответ в стандартную структуру. Ожидаемый интерфейс будет находиться в поле Response.Data. После обработки необходимо сделать assert вложенного интерфейса к ожидаемому (см. примеры)
Click to show internal directories.
Click to hide internal directories.