Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFailedMessagePublish indicates that message publishing failed. ErrFailedMessagePublish = errors.New("failed to publish message") // ErrFailedSubscription indicates that client couldn't subscribe to specified channel ErrFailedSubscription = errors.New("failed to subscribe to a channel") // ErrFailedUnsubscribe indicates that client couldn't unsubscribe from specified channel ErrFailedUnsubscribe = errors.New("failed to unsubscribe from a channel") // ErrFailedConnection indicates that service couldn't connect to message broker. ErrFailedConnection = errors.New("failed to connect to message broker") // ErrInvalidConnection indicates that client couldn't subscribe to message broker ErrInvalidConnection = errors.New("nats: invalid connection") ErrUnauthorizedAccess = errors.New("missing or invalid credentials provided") // ErrEmptyTopic indicate absence of thingKey in the request ErrEmptyTopic = errors.New("empty topic") // ErrEmptyID indicate absence of channelID in the request ErrEmptyID = errors.New("empty id") )
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, thingKey string, msg protomfx.Message) error
// Subscribe subscribes to a channel with specified id.
Subscribe(ctx context.Context, thingKey, chanID, subtopic string, client *Client) error
// Unsubscribe method is used to stop observing resource.
Unsubscribe(ctx context.Context, thingKey, chanID, subtopic string) error
}
Service specifies web socket service API.
Click to show internal directories.
Click to hide internal directories.