hj212

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 Hj212 terminology, Token similar to the Session ID.
	Token() string
	SendMessage(m messaging.Message) error
	Cancel() error
	Done() <-chan struct{}
}

Client wraps Hj212 client.

func NewClient

func NewClient(mc mux.Client, token message.Token, l logger.Logger) Client

NewClient instantiates a new Observer.

type Service

type Service interface {
	// Publish Messssage
	Publish(ctx context.Context, token 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.

func New

func New(publisher messaging.Publisher, things mainflux.ThingsServiceClient) Service

New instantiates the HTTP adapter implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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