publish

package
v0.0.0-...-5faa250 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pub

func Pub(cfg *Config)

Pub 执行Publish操作

Types

type Config

type Config struct {
	ExecNum         int    // 执行次数
	Interval        int    // 发布间隔
	UserInterval    int    // 好友发包间隔(单位毫秒)
	AutoReconnect   bool   // 自动重连
	DisconnectScale int    // 发送完成之后,断开客户端的比例
	IsStore         bool   // 是否执行持久化存储
	MongoUrl        string // MongoDB连接
	Network         string
	Address         string
	Qos             byte
	UserName        string
	Password        string
	CleanSession    bool
	KeepAlive       int
}

type HandleConnect

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

func NewHandleConnect

func NewHandleConnect(clientID string, pub *Publish) *HandleConnect

func (*HandleConnect) ErrorHandle

func (hc *HandleConnect) ErrorHandle(err error)

func (*HandleConnect) Subscribe

func (hc *HandleConnect) Subscribe(topicName, message []byte)

type Publish

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

func (*Publish) ExecPublish

func (p *Publish) ExecPublish()

func (*Publish) Init

func (p *Publish) Init() error

Jump to

Keyboard shortcuts

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