Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles messaging and websocket connection
type Service ¶
type Service interface {
// Publish Message
Publish(ctx context.Context, key domain.ThingKey, msg protomfx.Message) error
// Subscribe subscribes to a profile with specified id.
Subscribe(ctx context.Context, key domain.ThingKey, subtopic string, client *Client) error
// Unsubscribe method is used to stop observing resource.
Unsubscribe(ctx context.Context, key domain.ThingKey, subtopic string) error
// SendCommandToThing publishes a command to the specified thing, authorized by user token.
SendCommandToThing(ctx context.Context, token, thingID string, msg protomfx.Message) error
// SendCommandToThingByKey publishes a command to the specified thing, authorized by publisher thing key (M2M).
SendCommandToThingByKey(ctx context.Context, key domain.ThingKey, thingID string, msg protomfx.Message) error
// SendCommandToGroup publishes a command to things that belong to a specified group, authorized by user token.
SendCommandToGroup(ctx context.Context, token, groupID string, msg protomfx.Message) error
// SendCommandToGroupByKey publishes a command to a group, authorized by publisher thing key (M2M).
SendCommandToGroupByKey(ctx context.Context, key domain.ThingKey, groupID string, msg protomfx.Message) error
}
Service specifies web socket service API.
Click to show internal directories.
Click to hide internal directories.