Documentation ¶
Index ¶
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) CloseWithContext(ctx context.Context) error
- func (c *Connection) Connected() bool
- func (c *Connection) DataNormalized(regPointID string, archive archive.DataArchive, from, to RequestTime, ...) ([]byte, error)
- func (c *Connection) DataNormalizedWithContext(ctx context.Context, regPointID string, archive archive.DataArchive, ...) ([]byte, error)
- func (c *Connection) ListForDevelopment(flags ...Flag) ([]byte, error)
- func (c *Connection) ListForDevelopmentWithContext(ctx context.Context, flags ...Flag) ([]byte, error)
- func (c *Connection) Open(rawURL string, withAuth WithAuthOption) error
- func (c *Connection) OpenWithContext(ctx context.Context, rawURL string, withAuth WithAuthOption) error
- func (c *Connection) RawData(regPointID string, archive archive.DataArchive, from, to RequestTime, ...) ([]byte, error)
- func (c *Connection) RawDataWithContext(ctx context.Context, regPointID string, archive archive.DataArchive, ...) ([]byte, error)
- func (c *Connection) UOMList(flags ...Flag) ([]byte, error)
- func (c *Connection) UOMListWithContext(ctx context.Context, flags ...Flag) ([]byte, error)
- type ConnectionOption
- type Flag
- type InternalError
- type MethodCallError
- type RequestTime
- type UnhandledErrorFunc
- type WithAuthOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { // OnUnhandledError событие появления ошибки внутри соединения, которая не передается вызывающей стороне, но может // записана в лог вызывающей стороной OnUnhandledError UnhandledErrorFunc // contains filtered or unexported fields }
Connection соединение с API ЭЛДИС
func NewConnection ¶
func NewConnection(client *http.Client) (*Connection, error)
NewConnection возвращает новое соединение с API ЭЛДИС
func (*Connection) Close ¶
func (c *Connection) Close() error
Close закрывает соединение с API ЭЛДИС
func (*Connection) CloseWithContext ¶
func (c *Connection) CloseWithContext(ctx context.Context) error
CloseWithContext закрывает соединение с API ЭЛДИС
func (*Connection) Connected ¶
func (c *Connection) Connected() bool
Connected возвращает статус соединения с API ЭЛДИС
func (*Connection) DataNormalized ¶
func (c *Connection) DataNormalized(regPointID string, archive archive.DataArchive, from, to RequestTime, dateType date.Type, flags ...Flag) ([]byte, error)
DataNormalized вызывает метод /api/v2/data/normalized для получения нормализованных (после достоверизации) показаний на точке учета
func (*Connection) DataNormalizedWithContext ¶
func (c *Connection) DataNormalizedWithContext(ctx context.Context, regPointID string, archive archive.DataArchive, from, to RequestTime, dateType date.Type, flags ...Flag) ([]byte, error)
DataNormalizedWithContext вызывает метод /api/v2/data/normalized для получения нормализованных (после достоверизации) показаний на точке учета
func (*Connection) ListForDevelopment ¶
func (c *Connection) ListForDevelopment(flags ...Flag) ([]byte, error)
ListForDevelopment вызывает метод /api/v2/tv/listForDevelopment API для получения списка доступных точек учета
func (*Connection) ListForDevelopmentWithContext ¶
func (c *Connection) ListForDevelopmentWithContext(ctx context.Context, flags ...Flag) ([]byte, error)
ListForDevelopmentWithContext вызывает метод /api/v2/tv/listForDevelopment API для получения списка доступных точек учета
func (*Connection) Open ¶
func (c *Connection) Open(rawURL string, withAuth WithAuthOption) error
Open открывает соединение с API ЭЛДИС
func (*Connection) OpenWithContext ¶
func (c *Connection) OpenWithContext(ctx context.Context, rawURL string, withAuth WithAuthOption) error
OpenWithContext открывает соединение с API ЭЛДИС
func (*Connection) RawData ¶
func (c *Connection) RawData(regPointID string, archive archive.DataArchive, from, to RequestTime, flags ...Flag) ([]byte, error)
RawData вызывает метод /api/v2/data/rawData для получения "сырых" показаний на точке учета
func (*Connection) RawDataWithContext ¶
func (c *Connection) RawDataWithContext(ctx context.Context, regPointID string, archive archive.DataArchive, from, to RequestTime, flags ...Flag) ([]byte, error)
RawDataWithContext вызывает метод /api/v2/data/rawData для получения "сырых" показаний на точке учета
func (*Connection) UOMList ¶
func (c *Connection) UOMList(flags ...Flag) ([]byte, error)
UOMList вызывает метод /api/v2/uom/list API для получения списка единиц измерения
func (*Connection) UOMListWithContext ¶
UOMListWithContext вызывает метод /api/v2/uom/list API для получения списка единиц измерения
type ConnectionOption ¶
type ConnectionOption func(c *Connection)
ConnectionOption параметр соединения с API ЭЛДИС
type InternalError ¶
type InternalError struct { // RawURL адрес метода API RawURL string // Method HTTP метод Method string // Status состояние ошибки Status *response.Message // Err внутренняя ошибка API Err error }
InternalError внутренняя ошибка АИСКУТЭ ЭЛДИС при обработке запроса
func (*InternalError) Error ¶
func (e *InternalError) Error() string
type MethodCallError ¶
type MethodCallError struct { // RawURL адрес метода API RawURL string // Method HTTP-метод Method string // Err ошибка вызова метода Err error }
MethodCallError ошибка вызова метода API
func (*MethodCallError) Error ¶
func (e *MethodCallError) Error() string
type RequestTime ¶
RequestTime описывает формат времени, принятый в запросах к АИСКУТЭ ЭЛДИС
func (*RequestTime) String ¶
func (rt *RequestTime) String() string
String возвращает строковое представление типа RequestTime
type UnhandledErrorFunc ¶
type UnhandledErrorFunc func(err error)
UnhandledErrorFunc обработчик появления ошибки внутри соединения с API ЭЛДИС
type WithAuthOption ¶
type WithAuthOption ConnectionOption
WithAuthOption тип параметра соединения для авторизации клиента к API ЭЛДИС
func WithAuth ¶
func WithAuth(username, password, key string) WithAuthOption
WithAuth обязательный параметр соединения для авторизации клиента к API ЭЛДИС