cloud

package
v0.0.0-...-d8916d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultURL = "https://api.evotor.ru"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*restkit.Client
}

func NewClient

func NewClient(cfg ClientConfig) (*Client, error)

func (*Client) GetDevices

func (c *Client) GetDevices(ctx context.Context, token string) (iter.Seq[Device], func() error)

GetDevices returns a sequence of devices and a function to check for errors. The sequence is lazily loaded from the server using the provided token. The server will return a paginated list of devices, and the sequence will yield each device in the list. If there are more devices available, the sequence will automatically request the next page from the server. If an error occurs while loading the devices, the error function will return the error.

type ClientConfig

type ClientConfig struct {
	BaseURL string

	Client *http.Client
}

ClientConfig contains client options.

type Device

type Device struct {
	ID      string `json:"id"`       // Уникальный идентификатор смарт-терминала в Облаке Эвотор.
	Name    string `json:"name"`     // Имя смарт-терминала, которое пользователь дал устройству в Личном кабинете.
	StoreID string `json:"store_id"` // Уникальный идентификатор торговой точки в Облаке Эвотор.
	UserID  string `json:"user_id"`  // Идентификатор пользователя Эвотор.

	INN             string      `json:"inn"`              // ИНН владельца терминала.
	TimezoneOffset  int64       `json:"timezone_offset"`  // Часовой пояс, в котором работает смарт-терминал. Представлен в виде смещения в миллисекундах относительно часового пояса UTC.
	IMEI            string      `json:"imei"`             // IMEI смарт-терминала.
	FirmwareVersion string      `json:"firmware_version"` // Версия ПО смарт-терминала.
	Location        Location    `json:"location"`         // GPS-координаты смарт-терминала.
	SerialNumber    string      `json:"serial_number"`    // Серийный номер устройства. Состоит из 14-и символов. Написан на наклейке на обратной стороне Эвотора.
	DeviceModel     DeviceModel `json:"device_model"`     // Модель устройства
	CreatedAt       time.Time   `json:"created_at"`       // Дата и время создания объекта
	UpdatedAt       time.Time   `json:"updated_at"`       // Дата и время обновления данных объекта
}

type DeviceModel

type DeviceModel string
const (
	DeviceModel10      DeviceModel = "10"
	DeviceModel72      DeviceModel = "7_2"
	DeviceModel72ATOL  DeviceModel = "7_2_ATOL"
	DeviceModel73      DeviceModel = "7_3"
	DeviceModel5       DeviceModel = "5"
	DeviceModel5I      DeviceModel = "5_I"
	DeviceModelPower   DeviceModel = "POWER"
	DeviceModelUnknown DeviceModel = "UNKNOWN"
)

type Location

type Location struct {
	Lng float64 `json:"lng"` // Долгота
	Lat float64 `json:"lat"` // Широта
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL