cmpp

package
v0.0.0-...-17c6332 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmppConf

type CmppConf struct {
	Addr         string
	SourceAddr   string
	SharedSecret string

	ServiceId string
	SrcId     string
}

type DeliverHandler

type DeliverHandler func(dlv *protocol.Deliver)

type LongtextCmpp

type LongtextCmpp struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

LongtextCmpp 客户端 在 CmppConn上增加 1. 自动keepalive 2. 断线重连 3. Deliver处理 4. 同步发送长短信 TODO: 长文本上行

func NewLongtextCmpp

func NewLongtextCmpp(c CmppConf, deliverHandler DeliverHandler) (*LongtextCmpp, error)

func (*LongtextCmpp) Close

func (c *LongtextCmpp) Close()

Close CmppConn and set available=false

func (*LongtextCmpp) Exit

func (c *LongtextCmpp) Exit()

func (*LongtextCmpp) IsAvailable

func (c *LongtextCmpp) IsAvailable() bool

func (*LongtextCmpp) KeepOpen

func (c *LongtextCmpp) KeepOpen()

KeepOpen cmpp连接断开自动重连

func (*LongtextCmpp) Open

func (c *LongtextCmpp) Open()

Open CmppConn

func (*LongtextCmpp) ResetConn

func (c *LongtextCmpp) ResetConn() error

func (*LongtextCmpp) SubmitLongtext

func (c *LongtextCmpp) SubmitLongtext(phone, content, serviceID, srcID string) (*SubmitLongtextResp, error)

type Segment

type Segment struct {
	MsgId   uint64 // MsgId == 0 发送失败
	Result  uint8
	Content string
}

type SubmitLongtextResp

type SubmitLongtextResp struct {
	Total int
	Data  []Segment
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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