global

package
v0.0.0-...-88f3d6a Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Conf .

View Source
var EtcdPoint, Region, Ethname, MSName, Dbs, LanIP string
View Source
var MicrosConn, EXChangeConn *pprpcpool.MicroClientConn

MicrosConn micro service connections.

View Source
var Service, AuthService, EXChangeMsgService *pprpc.Service

Service,AuthService global service

Sess 存放所有连接

View Source
var SvcAgent *svc.Agent
View Source
var SvcWatcher *svc.Watcher
View Source
var TopicCache *rsub.RSub

Functions

func LoadConf

func LoadConf(filePath string) (conf svc.MSConfig, err error)

LoadConf load conf

Types

type ClearSameConf

type ClearSameConf struct {
	Clear        bool     `json:"clear,omitempty"`
	WhiteAccount []string `json:"white_account,omitempty"`
}

ClearSameConf clear same id

type ConnAttr

type ConnAttr struct {
	ClientID     string
	Account      string
	IsAuth       bool
	UserID       int64
	ConnectFlag  bool
	OfflineEvent bool

	EncType     uint8
	MessageType uint8

	ClearSession int32
	WillFlag     uint32
	WillQos      uint32
	WillRetain   uint32
	WillTopic    string
	WillBody     string
	HbInterval   uint32

	HistorymsgType  int32
	HistorymsgCount int32

	ConnStatus int32
	ConnType   int32
	LastTime   int64
	ISSleep    int32

	RemoteIpaddr string
	// time.Timer
	Timers            *cache.Cache
	CmdChan           chan *packets.CmdPacket
	HistoryCmdList    *list.List
	HistoryPubackSync chan uint16
	RunSub            bool
	SendOfflinemsgEnd bool
}

ConnAttr .

func (*ConnAttr) ClearTimer

func (attr *ConnAttr) ClearTimer()

ClearTimer clear timer

func (*ConnAttr) StartTimer

func (attr *ConnAttr) StartTimer(d time.Duration, seq uint64, fn func())

StartTimer start timer

func (*ConnAttr) StopTimer

func (attr *ConnAttr) StopTimer(key string)

StopTimer stop timer by key.

type HistoryList

type HistoryList struct {
	MsgID  string
	CmdPkg *packets.CmdPacket
}

type MicroClient

type MicroClient struct {
	Name string   `json:"name,omitempty"`
	URIS []string `json:"uris,omitempty"`
}

MicroClient micrl service client

type PpmqConf

type PpmqConf struct {
	OnlineNotify      bool   `json:"online_notify"`
	OfflineNotify     bool   `json:"offline_notify"`
	UDPHbsec          uint32 `json:"udp_hbsec"`
	TCPHbsec          uint32 `json:"tcp_hbsec"`
	NotifyTopicPrefix string `json:"notify_topic_prefix"` // Online Offline 通知事件的前缀 Prefix/clientid
	//ServerID          string `json:"server_id"`
	MaxSessions              int32  `json:"max_sessions"`
	Mode                     string `json:"mode"`
	ClusterSignkey           string `json:"cluster_signkey,omitempty"`
	Qos                      bool   `json:"qos,omitempty"`
	SSOEnable                bool   `json:"sso_enable,omitempty"`
	UDPRespTimeoutms         int64  `json:"udp_resp_timeoutms,omitempty"`
	OfflinemsgTimeoutms      int64  `json:"offlinemsg_timeoutms,omitempty"`
	OfflinemsgSendSleepms    int64  `json:"offlinemsg_send_sleepms,omitempty"`
	OfflinemsgSendIntervalms int64  `json:"offlinemsg_send_intervalms,omitempty"`
	MessageOrder             int64  `json:"message_order,omitempty"`
	MessageOrderLength       int    `json:"message_order_length,omitempty"`
	TempdbExpiredms          int64  `json:"tempdb_expiredms,omitempty"`
	TempdbClearIntervalsec   int64  `json:"tempdb_clear_intervalsec,omitempty"`
}

PpmqConf .

type PrivateConf

type PrivateConf struct {
	Ppmq         PpmqConf      `json:"ppmq"`
	MaxSession   int32         `json:"max_session"`
	DevicePrefix string        `json:"device_prefix,omitempty"`
	Auth         int32         `json:"auth"` // 1 local db; 2 auth micro service.
	CheckTopic   int32         `json:"check_topic"`
	Micros       []MicroClient `json:"micros,omitempty"` // authuser, authdevice
	Redis        svc.RedisConf `json:"redis"`
	ClearDIDConf ClearSameConf `json:"clear_sameid"`
}

PrivateConf private conf

var PConf PrivateConf

Jump to

Keyboard shortcuts

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