Documentation ¶
Overview ¶
Package coap contains the domain concept definitions needed to support Mainflux CoAP adapter service functionality. All constant values are taken from RFC, and could be adjusted based on specific use case.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsubscribe = errors.New("unable to unsubscribe") )
Exported errors
View Source
var ErrOption = errors.New("unable to set option")
ErrOption indicates an error when adding an option.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // In CoAP terminology, Token similar to the Session ID. Token() string SendMessage(m messaging.Message) error Cancel() error Done() <-chan struct{} }
Client wraps CoAP client.
type Observer ¶
type Observer interface {
Cancel() error
}
Observer represents an internal observer used to handle CoAP observe messages.
type Service ¶
type Service interface { // Publish Messssage Publish(ctx context.Context, key string, msg messaging.Message) error // Subscribes to channel with specified id, subtopic and adds subscription to // service map of subscriptions under given ID. Subscribe(ctx context.Context, key, chanID, subtopic string, c Client) error // Unsubscribe method is used to stop observing resource. Unsubscribe(ctx context.Context, key, chanID, subptopic, token string) error }
Service specifies CoAP service API.
Click to show internal directories.
Click to hide internal directories.