emq

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 6 Imported by: 0

README

Event Message Queue

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Events []*Event
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options Options) *Client

func (*Client) Connect

func (client *Client) Connect() error

func (*Client) CreateEvent

func (client *Client) CreateEvent(topic string, qos QoS) *Event

func (*Client) Disconnect

func (client *Client) Disconnect()

func (*Client) Subscribe

func (client *Client) Subscribe() (chan Message, error)

type Event

type Event struct {
	Topic string `json:"topic"`
	QoS   QoS    `json:"qos"`
	// contains filtered or unexported fields
}

func (*Event) Publish

func (event *Event) Publish(payload interface{}) error

type Message

type Message struct {
	Timestamp time.Time `json:"timestamp"`
	ID        uint16    `json:"id"`
	Event     Event     `json:"event"`
	Payload   []byte    `json:"payload"`
}

type Options

type Options struct {
	Broker   string
	Username string
	Password string
}

type QoS

type QoS byte
const (
	AtMostOnce  QoS = 0
	AtLeastOnce QoS = 1
	ExactlyOnce QoS = 2
)

Jump to

Keyboard shortcuts

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