interfaces

package
v1.0.39 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingLastValue = errors.New("missing last value in mgw-last-value")
View Source
var ErrMissingLastValueCode = 513 //custom code to signify missing last-value in mgw-last-value

Functions

This section is empty.

Types

type ComFactory

type ComFactory func(ctx context.Context, config configuration.Config, responseListener func(msg messages.ProtocolMsg) error, errorListener func(msg messages.ProtocolMsg) error) (producer Producer, err error)

type Iot

type Iot interface {
	GetDevice(token string, id string) (result model.Device, err error)
	GetDeviceGroup(token string, id string) (result model.DeviceGroup, err error)
	GetService(token string, device model.Device, id string) (result model.Service, err error)
	GetDeviceType(token string, id string) (result model.DeviceType, err error)
	GetProtocol(token string, id string) (result model.Protocol, err error)
	ListFunctions() (functionInfos []model.Function, err error)
	GetFunction(id string) (result model.Function, err error)
	GetConcept(id string) (result model.Concept, err error)
	GetCharacteristic(id string) (result model.Characteristic, err error)
	GetAspectNode(id string) (model.AspectNode, error)
	GetConceptIds() ([]string, error)
}

type IotFactory

type IotFactory func(ctx context.Context, config configuration.Config) (Iot, error)

type Marshaller

type Marshaller interface {
	MarshalFromServiceAndProtocol(characteristicId string, service model.Service, protocol model.Protocol, characteristicData interface{}, configurables []marshaller.Configurable) (result map[string]string, err error)
	UnmarshalFromServiceAndProtocol(characteristicId string, service model.Service, protocol model.Protocol, message map[string]string, hints []string) (characteristicData interface{}, err error)

	MarshalV2(service model.Service, protocol model.Protocol, data []marshaller.MarshallingV2RequestData) (result map[string]string, err error)
	UnmarshalV2(request marshaller.UnmarshallingV2Request) (characteristicData interface{}, err error)
}

type MarshallerFactory

type MarshallerFactory func(ctx context.Context, config configuration.Config, iot Iot) (Marshaller, error)

type Producer

type Producer interface {
	SendCommand(msg messages.ProtocolMsg) (err error)
}

type Timescale

type Timescale interface {
	GetLastMessage(token auth.Token, device models.Device, service models.Service, protocol model.Protocol, timeout time.Duration) (result map[string]interface{}, err error)
}

type TimescaleFactory

type TimescaleFactory func(ctx context.Context, config configuration.Config) (Timescale, error)

Jump to

Keyboard shortcuts

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