network

package
v1.0.4-0...-7069f2b Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amqp

type Amqp struct {
	// contains filtered or unexported fields
}

Amqp handles the connection, queues and exchanges declared

func NewAmqp

func NewAmqp(url string, logger logging.Logger) *Amqp

NewAmqp constructs the AMQP connection handler

func (*Amqp) OnMessage

func (a *Amqp) OnMessage(msgChan chan InMsg, queueName, exchangeName, exchangeType, key string) error

OnMessage receive messages and put them on channel

func (*Amqp) Start

func (a *Amqp) Start(started chan bool)

Start starts the handler

func (*Amqp) Stop

func (a *Amqp) Stop()

Stop closes the connection started

type DataPublish

type DataPublish struct {
	ID   string             `json:"id"`
	Data []entities.Payload `json:"data"`
}

DataPublish represents the incoming publish data command

type DeviceUnregistered

type DeviceUnregistered struct {
	ID string `json:"id"`
}

DeviceUnregistered represents the incoming unregistered device event

type InMsg

type InMsg struct {
	Exchange   string
	RoutingKey string
	Headers    map[string]interface{}
	Body       []byte
}

InMsg represents the message received from the AMQP broker

Jump to

Keyboard shortcuts

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