Documentation
¶
Index ¶
- func FetchXRTResWithSubTimeout(ctx context.Context, requestId string, requestMap RequestMap, ...) errors.EdgeX
- func FetchXRTResponse(ctx context.Context, requestId string, requestMap RequestMap, ...) ([]byte, errors.EdgeX)
- func NewXrtClient(ctx context.Context, messageBus messaging.MessageClient, requestTopic string, ...) (interfaces.EdgeClient, errors.EdgeX)
- type Client
- func (c *Client) AddDevice(ctx context.Context, device dtos.Device) errors.EdgeX
- func (c *Client) AddDeviceProfile(ctx context.Context, profile dtos.DeviceProfile) errors.EdgeX
- func (c *Client) AddDiscoveredDevice(ctx context.Context, device dtos.Device) errors.EdgeX
- func (c *Client) AddSchedule(ctx context.Context, schedule xrtmodels.Schedule) errors.EdgeX
- func (c *Client) AllDeviceProfiles(ctx context.Context) ([]string, errors.EdgeX)
- func (c *Client) AllDevices(ctx context.Context) ([]string, errors.EdgeX)
- func (c *Client) AllSchedules(ctx context.Context) ([]string, errors.EdgeX)
- func (c *Client) Close() errors.EdgeX
- func (c *Client) DeleteDeviceByName(ctx context.Context, name string) errors.EdgeX
- func (c *Client) DeleteDeviceProfileByName(ctx context.Context, name string) errors.EdgeX
- func (c *Client) DeleteScheduleByName(ctx context.Context, name string) errors.EdgeX
- func (c *Client) DeviceByName(ctx context.Context, name string) (xrtmodels.DeviceInfo, errors.EdgeX)
- func (c *Client) DeviceProfileByName(ctx context.Context, name string) (dtos.DeviceProfile, errors.EdgeX)
- func (c *Client) DiscoverComponents(ctx context.Context, category string, subscribeTimeout time.Duration) ([]xrtmodels.MultiComponentsResponse, errors.EdgeX)
- func (c *Client) ReadDeviceResources(ctx context.Context, deviceName string, resourceNames []string) (xrtmodels.MultiResourcesResult, errors.EdgeX)
- func (c *Client) ScanDevice(ctx context.Context, device dtos.Device, options map[string]any) errors.EdgeX
- func (c *Client) SetResponseTimeout(responseTimeout time.Duration)
- func (c *Client) TriggerDiscovery(ctx context.Context) errors.EdgeX
- func (c *Client) UpdateDevice(ctx context.Context, device dtos.Device) errors.EdgeX
- func (c *Client) UpdateDeviceProfile(ctx context.Context, profile dtos.DeviceProfile) errors.EdgeX
- func (c *Client) UpdateLuaScript(ctx context.Context, luaScript string) errors.EdgeX
- func (c *Client) WriteDeviceResources(ctx context.Context, deviceName string, ...) errors.EdgeX
- type ClientOptions
- type CommandOptions
- type DiscoveryOptions
- type MessageHandler
- type RequestMap
- type StatusOptions
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchXRTResWithSubTimeout ¶
func FetchXRTResWithSubTimeout(ctx context.Context, requestId string, requestMap RequestMap, subscribeTimeout time.Duration, response any) errors.EdgeX
FetchXRTResWithSubTimeout subscribe multiple messages of the same requestId for the given subscribe timeout, and the result will be appended in the response slice After the subscribe timeout, the response slice pointer will be returned
func FetchXRTResponse ¶
func NewXrtClient ¶
func NewXrtClient(ctx context.Context, messageBus messaging.MessageClient, requestTopic string, replyTopic string, responseTimeout time.Duration, lc logger.LoggingClient, clientOptions *ClientOptions) (interfaces.EdgeClient, errors.EdgeX)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the client of MQTT management API, https://docs.iotechsys.com/edge-xrt21/mqtt-management/mqtt-management.html
func (*Client) AddDeviceProfile ¶
func (*Client) AddDiscoveredDevice ¶
AddDiscoveredDevice adds discovered device without profile, which means the device is not usable until the profile is set or generate by device:scan
func (*Client) AddSchedule ¶
func (*Client) AllDeviceProfiles ¶
func (*Client) AllDevices ¶
func (*Client) AllSchedules ¶
func (*Client) DeleteDeviceByName ¶
func (*Client) DeleteDeviceProfileByName ¶
func (*Client) DeleteScheduleByName ¶
func (*Client) DeviceByName ¶
func (*Client) DeviceProfileByName ¶
func (*Client) DiscoverComponents ¶
func (*Client) ReadDeviceResources ¶
func (*Client) ScanDevice ¶
func (c *Client) ScanDevice(ctx context.Context, device dtos.Device, options map[string]any) errors.EdgeX
ScanDevice checks a device profile for updates.
func (*Client) SetResponseTimeout ¶
func (*Client) TriggerDiscovery ¶
func (*Client) UpdateDevice ¶
func (*Client) UpdateDeviceProfile ¶
func (*Client) UpdateLuaScript ¶
type ClientOptions ¶
type ClientOptions struct { *CommandOptions *DiscoveryOptions *StatusOptions }
func NewClientOptions ¶
func NewClientOptions(commandOptions *CommandOptions, discoveryOptions *DiscoveryOptions, statusOptions *StatusOptions) *ClientOptions
type CommandOptions ¶
type CommandOptions struct { CommandTopic string DiscoveryTopic string DiscoveryMessageHandler MessageHandler }
CommandOptions provides the config for sending the request to manage components
func NewCommandOptions ¶
func NewCommandOptions(commandTopic string, discoveryTopic string, discoveryMessageHandler MessageHandler) *CommandOptions
type DiscoveryOptions ¶
type DiscoveryOptions struct { DiscoveryTopic string DiscoveryMessageHandler MessageHandler DiscoveryDuration time.Duration DiscoveryTimeout time.Duration ExtentedDiscoveryOptions map[string]any }
DiscoveryOptions provides the config for sending the discovery request like discovery:trigger, device:scan
func NewDiscoveryOptions ¶
func NewDiscoveryOptions(discoveryTopic string, discoveryMessageHandler MessageHandler, discoveryDuration, discoveryTimeout time.Duration) *DiscoveryOptions
func NewDiscoveryOptionsExtended ¶
func NewDiscoveryOptionsExtended(discoveryTopic string, discoveryMessageHandler MessageHandler, discoveryDuration, discoveryTimeout time.Duration, extendedDiscoveryOptions map[string]any) *DiscoveryOptions
type MessageHandler ¶
type MessageHandler func(message types.MessageEnvelope)
type RequestMap ¶
RequestMap maintains the mapping between requestId and command response channel of []byte type
func NewRequestMap ¶
func NewRequestMap() RequestMap
type StatusOptions ¶
type StatusOptions struct { StatusTopic string StatusMessageHandler MessageHandler }
StatusOptions provides the config for subscribing the XRT status
func NewStatusOptions ¶
func NewStatusOptions(statusTopic string, statusMessageHandler MessageHandler) *StatusOptions
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}