models

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChangeChan chan messages.Message

ChangeChan is a change msg queue

View Source
var InformChan chan Receive

InformChan is a inform msg queue,used for device log

Functions

func FromMessage

func FromMessage(m Message) messages.Message

FromMessage tr069 msg decode

func Reply

func Reply(msg Message, sendTo string) (err error)

Reply rpc reply

func SendMsg

func SendMsg(msg Message, sendTo string) (err error)

SendMsg send msg

func SendText

func SendText(text, sendTo string) (err error)

SendText send text

Types

type InformMessage

type InformMessage struct {
	Inform    *messages.Inform
	Timestamp string
}

InformMessage used to store device inform

type Message

type Message struct {
	MessageProperties
	Body []byte
}

Message amqp msg

func CreateMessage

func CreateMessage(m messages.Message, properties MessageProperties) (Message, error)

CreateMessage tr069 msg encode

func ReciveMsg

func ReciveMsg(queue string) (message Message)

ReciveMsg query msg

type MessageProperties

type MessageProperties struct {
	Headers         amqp.Table
	CorrelationID   string
	ReplyTo         string
	ContentEncoding string
	ContentType     string
	Expiration      string
}

MessageProperties amqp msg property

type RabbitMQ

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

RabbitMQ conn info

func (*RabbitMQ) Close

func (r *RabbitMQ) Close() (err error)

Close close conn

func (*RabbitMQ) Connect

func (r *RabbitMQ) Connect() (err error)

Connect create a new amqp conn

type Receive

type Receive struct {
	Sn            string
	BytesReceived string
}

Receive device log

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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