6 Star 15 Fork 12

Ljolan/SI-MQTT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
plantuml.puml 33.97 KB
一键复制 编辑 原始数据 按行查看 历史
Ljolan 提交于 2021-08-27 15:00 . 集群设计init
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411
@startuml
namespace core {}
namespace store {}
namespace logger {}
namespace corev5 {}
namespace core.topics {}
namespace core.cluster {}
namespace corev5.authv5 {}
namespace corev5.topicsv5 {}
namespace config {
class SIConfig {
+ ServerVersion string
+ Log Log
+ Broker Broker
+ Cluster Cluster
+ DefaultConfig DefaultConfig
+ Store Store
+ PProf PProf
}
}
namespace config {
class Log {
+ Level string
}
}
namespace config {
class PProf {
+ Open bool
+ Port int64
}
}
namespace config {
class Broker {
+ TcpAddr string
+ TcpTLSOpen bool
+ WsAddr string
+ WsPath string
+ WssAddr string
+ WssCertPath string
+ WssKeyPath string
+ Ca string
}
}
namespace config {
class Cluster {
+ Enabled bool
+ ClusterName string
+ ClusterHost string
+ ClusterPort int
+ ClusterTLS bool
+ ServerCertFile string
+ ServerKeyFile string
+ ClientCertFile string
+ ClientKeyFile string
}
}
namespace config {
class Connect {
+ Keepalive int
+ WriteTimeout int
+ ConnectTimeout int
+ AckTimeout int
+ TimeoutRetries int
}
}
namespace config {
class Provider {
+ SessionsProvider string
+ TopicsProvider string
+ Authenticator string
}
}
namespace config {
class DefaultConfig {
+ Connect Connect
+ Provider Provider
+ Auth Auth
+ Server Server
}
}
namespace config {
class Auth {
+ Allows []string
}
}
namespace config {
class Server {
+ Redirects []string
+ RedirectOpen bool
+ RedirectIsForEver bool
}
}
namespace config {
class Mysql {
+ Source string
+ PoolSize int
}
}
namespace config {
class Redis {
+ Source string
+ Db int
+ PoolSize int
}
}
namespace config {
class Store {
+ Mysql Mysql
+ Redis Redis
}
}
namespace core.auth {
class Manager {
- p Authenticator
}
}
namespace core.message {
class ConnackMessage {
- header
- sessionPresent bool
- returnCode ConnackCode
}
}
namespace core.message {
class ConnectMessage {
- header
- connectFlags byte
- version byte
- keepAlive uint16
- protoName,clientId,willTopic,willMessage,username,password []byte
}
}
namespace core.message {
class DisconnectMessage {
- header
}
}
namespace core.message {
class header {
- remlen int32
- mtypeflags []byte
- packetId []byte
- dbuf []byte
- dirty bool
}
}
namespace core.message {
class PingreqMessage {
+ DisconnectMessage
}
}
namespace core.message {
class PingrespMessage {
+ DisconnectMessage
}
}
namespace core.message {
class PubackMessage {
- header
}
}
namespace core.message {
class PubcompMessage {
+ PubackMessage
}
}
namespace core.message {
class PublishMessage {
- header
- topic []byte
- payload []byte
}
}
namespace core.message {
class PubrecMessage {
+ PubackMessage
}
}
namespace core.message {
class PubrelMessage {
+ PubackMessage
}
}
namespace core.message {
class SubackMessage {
- header
- returnCodes []byte
}
}
namespace core.message {
class SubscribeMessage {
- header
- topics [][]byte
- qos []byte
}
}
namespace core.message {
class UnsubackMessage {
+ PubackMessage
}
}
namespace core.message {
class UnsubscribeMessage {
- header
- topics [][]byte
}
}
namespace core.service {
class sequence {
- cursor,gate,p2,p3,p4,p5,p6,p7 int64
}
}
namespace core.service {
class buffer {
- id int64
- buf []byte
- tmp []byte
- size int64
- mask int64
- done int64
- pseq *sequence
- cseq *sequence
- pcond *sync.Cond
- ccond *sync.Cond
- cwait int64
- pwait int64
}
}
namespace core.service {
class SafeMap {
- v map[uint16]interface { }
- wg *sync.RWMutex
}
}
namespace core.service {
class timeoutReader {
- d time.Duration
- conn netReader
}
}
namespace core.service {
class Server {
+ Version string
+ KeepAlive int
+ ConnectTimeout int
+ AckTimeout int
+ TimeoutRetries int
+ Authenticator string
+ SessionsProvider string
+ TopicsProvider string
- authMgr *auth.Manager
- sessMgr *sessions.Manager
- topicsMgr *topics.Manager
- quit chan struct { }
- ln net.Listener
- svcs []*service
- mu sync.Mutex
- running int32
- configOnce sync.Once
- subs []interface { }
- qoss []byte
}
}
namespace core.service {
class stat {
- bytes int64
- msgs int64
}
}
namespace core.service {
class service {
- id uint64
- ccid string
- client bool
- keepAlive int
- connectTimeout int
- ackTimeout int
- timeoutRetries int
- conn io.Closer
- sessMgr *sessions.Manager
- topicsMgr *topics.Manager
- sess *sessions.Session
- wgStarted sync.WaitGroup
- wgStopped sync.WaitGroup
- wmu sync.Mutex
- closed int64
- done chan struct { }
- in *buffer
- out *buffer
- onpub OnPublishFunc
- inStat stat
- outStat stat
- intmp []byte
- outtmp []byte
- subs []interface { }
- qoss []byte
- rmsgs []*message.PublishMessage
}
}
namespace core.sessions {
class ackmsg {
+ Mtype message.MessageType
+ State message.MessageType
+ Pktid uint16
+ Msgbuf []byte
+ Ackbuf []byte
+ OnComplete interface { }
}
}
namespace core.sessions {
class Ackqueue {
- size int64
- mask int64
- count int64
- head int64
- tail int64
- ping ackmsg
- ring []ackmsg
- emap map[uint16]int64
- ackdone []ackmsg
- mu sync.Mutex
}
}
namespace core.sessions {
class memProvider {
- st map[string]*Session
- mu sync.RWMutex
}
}
namespace core.sessions {
class Session {
+ Pub1ack *Ackqueue
+ Pub2in *Ackqueue
+ Pub2out *Ackqueue
+ Suback *Ackqueue
+ Unsuback *Ackqueue
+ Pingack *Ackqueue
+ Cmsg *message.ConnectMessage
+ Will *message.PublishMessage
+ Retained *message.PublishMessage
- cbuf []byte
- rbuf []byte
- topics map[string]byte
- initted bool
- mu sync.Mutex
- id string
}
}
namespace core.sessions {
class Manager {
- p SessionsProvider
}
}
namespace core.topics {
class memTopics {
- smu sync.RWMutex
- sroot *snode
- rmu sync.RWMutex
- rroot *rnode
- share share.ShareTopicsProvider
- sys sys.SysTopicsProvider
}
}
namespace core.topics {
class snode {
- subs []interface { }
- qos []byte
- snodes map[string]*snode
}
}
namespace core.topics {
class rnode {
- msg *message.PublishMessage
- buf []byte
- rnodes map[string]*rnode
}
}
namespace core.topics.share {
class memTopics {
- smu sync.RWMutex
- sroot *snode
- rmu sync.RWMutex
- rroot *rnode
}
}
namespace core.topics.share {
class sins {
- subs []interface { }
- qos []byte
}
}
namespace core.topics.share {
class snode {
- shares map[string]*sins
- snodes map[string]*snode
}
}
namespace core.topics.share {
class rnode {
- msg *message.PublishMessage
- buf []byte
- rnodes map[string]*rnode
}
}
namespace core.topics.share {
class Manager {
- p ShareTopicsProvider
}
}
namespace core.topics.sys {
class memTopics {
- smu sync.RWMutex
- sroot *rSnode
- rmu sync.RWMutex
- rroot *rRnode
}
}
namespace core.topics.sys {
class rSnode {
- subs []interface { }
- qos []byte
- rsnodes map[string]*rSnode
}
}
namespace core.topics.sys {
class rRnode {
- msg *message.PublishMessage
- buf []byte
- rrnodes map[string]*rRnode
}
}
namespace core.topics.sys {
class Manager {
- p SysTopicsProvider
}
}
namespace core.topics {
class Manager {
- p TopicsProvider
}
}
namespace corev5.authv5 {
class Manager {
- p Authenticator
}
}
namespace corev5.authv5.authplus {
class Manager {
- p AuthPlus
}
}
namespace corev5.authv5.authplus {
class defaultAuth {
- i int
}
}
namespace corev5.messagev5 {
class AuthMessage {
- header
- reasonCode ReasonCode
- propertiesLen uint32
- authMethod []byte
- authData []byte
- reasonStr []byte
- userProperty [][]byte
}
}
namespace corev5.messagev5 {
class ConnackMessage {
- header
- sessionPresent bool
- reasonCode ReasonCode
- propertiesLen uint32
- sessionExpiryInterval uint32
- receiveMaximum uint16
- maxQos byte
- retainAvailable byte
- maxPacketSize uint32
- assignedIdentifier []byte
- topicAliasMax uint16
- reasonStr []byte
- userProperties [][]byte
- wildcardSubscriptionAvailable byte
- subscriptionIdentifierAvailable byte
- sharedSubscriptionAvailable byte
- serverKeepAlive uint16
- responseInformation []byte
- serverReference []byte
- authMethod []byte
- authData []byte
}
}
namespace corev5.messagev5 {
class ConnectMessage {
- header
- connectFlags byte
- version byte
- keepAlive uint16
- protoName,clientId,willTopic,willMessage,username,password []byte
- propertiesLen uint32
- sessionExpiryInterval uint32
- receiveMaximum uint16
- maxPacketSize uint32
- topicAliasMax uint16
- requestRespInfo byte
- requestProblemInfo byte
- userProperty [][]byte
- authMethod []byte
- authData []byte
- willPropertiesLen uint32
- willDelayInterval uint32
- payloadFormatIndicator byte
- willMsgExpiryInterval uint32
- contentType []byte
- willUserProperty [][]byte
- responseTopic []byte
- correlationData []byte
}
}
namespace corev5.messagev5 {
class DisconnectMessage {
- header
- reasonCode ReasonCode
- propertyLen uint32
- sessionExpiryInterval uint32
- reasonStr []byte
- serverReference []byte
- userProperty [][]byte
}
}
namespace corev5.messagev5 {
class header {
- remlen int32
- mtypeflags []byte
- packetId []byte
- dbuf []byte
- dirty bool
}
}
namespace corev5.messagev5 {
class PingreqMessage {
- header
}
}
namespace corev5.messagev5 {
class PingrespMessage {
- header
}
}
namespace corev5.messagev5 {
class PubackMessage {
- header
- reasonCode ReasonCode
- propertyLen uint32
- reasonStr []byte
- userProperty [][]byte
}
}
namespace corev5.messagev5 {
class PubcompMessage {
+ PubackMessage
}
}
namespace corev5.messagev5 {
class PublishMessage {
- header
- topic []byte
- propertiesLen uint32
- payloadFormatIndicator byte
- messageExpiryInterval uint32
- topicAlias uint16
- responseTopic []byte
- correlationData []byte
- userProperty [][]byte
- subscriptionIdentifier uint32
- contentType []byte
- payload []byte
}
}
namespace corev5.messagev5 {
class PubrecMessage {
+ PubackMessage
}
}
namespace corev5.messagev5 {
class PubrelMessage {
+ PubackMessage
}
}
namespace corev5.messagev5 {
class SubackMessage {
- header
- propertiesLen uint32
- reasonStr []byte
- userProperty [][]byte
- reasonCodes []byte
}
}
namespace corev5.messagev5 {
class SubscribeMessage {
- header
- propertiesLen uint32
- subscriptionIdentifier uint32
- userProperty [][]byte
- topics [][]byte
- qos []byte
}
}
namespace corev5.messagev5 {
class UnsubackMessage {
- header
- propertyLen uint32
- reasonStr []byte
- userProperty [][]byte
- reasonCodes []byte
}
}
namespace corev5.messagev5 {
class UnsubscribeMessage {
- header
- propertyLen uint32
- userProperty [][]byte
- topics [][]byte
}
}
namespace corev5.model {
class Session {
- clientId string
- status Status
- offlineTime int64
}
}
namespace corev5.model {
class Subscription {
- clientId string
- qos int
- topic string
}
}
namespace corev5.servicev5 {
class sequence {
- cursor,gate,p2,p3,p4,p5,p6,p7 int64
}
}
namespace corev5.servicev5 {
class buffer {
- id int64
- buf []byte
- tmp []byte
- size int64
- mask int64
- done int64
- pseq *sequence
- cseq *sequence
- pcond *sync.Cond
- ccond *sync.Cond
- cwait int64
- pwait int64
}
}
namespace corev5.servicev5 {
class Client {
+ KeepAlive int
+ ConnectTimeout int
+ AuthPlus authplus.AuthPlus
+ AckTimeout int
+ TimeoutRetries int
- svc *service
}
}
namespace corev5.servicev5 {
class SafeMap {
- v map[uint16]interface { }
- wg *sync.RWMutex
}
}
namespace corev5.servicev5 {
class timeoutWriter {
- d time.Duration
- conn netWriter
}
}
namespace corev5.servicev5 {
class timeoutReader {
- d time.Duration
- conn netReader
}
}
namespace corev5.servicev5 {
class Server {
+ Version string
+ ConFig *config.SIConfig
+ KeepAlive int
+ WriteTimeout int
+ ConnectTimeout int
+ AckTimeout int
+ TimeoutRetries int
+ Authenticator string
+ SessionsProvider string
+ TopicsProvider string
+ AuthPlusProvider []string
- authMgr *authv5.Manager
- authPlusAllows map[string]*authplus.Manager
- sessMgr *sessionsv5.Manager
- topicsMgr *topicsv5.Manager
- quit chan struct { }
- ln net.Listener
- svcs []*service
- mu sync.Mutex
- running int32
- configOnce sync.Once
- subs []interface { }
- qoss []byte
}
}
namespace corev5.servicev5 {
class stat {
- bytes int64
- msgs int64
}
}
namespace corev5.servicev5 {
class service {
- id uint64
- ccid string
- client bool
- keepAlive int
- writeTimeout int
- connectTimeout int
- ackTimeout int
- timeoutRetries int
- conn io.Closer
- sessMgr *sessionsv5.Manager
- topicsMgr *topicsv5.Manager
- sess sessionsv5.Session
- wgStarted sync.WaitGroup
- wgStopped sync.WaitGroup
- wmu sync.Mutex
- closed int64
- done chan struct { }
- in *buffer
- out *buffer
- onpub OnPublishFunc
- inStat stat
- outStat stat
- intmp []byte
- outtmp []byte
- subs []interface { }
- qoss []byte
- rmsgs []*messagev5.PublishMessage
}
}
namespace corev5.sessionsv5 {
class ackmsg {
+ Mtype messagev5.MessageType
+ State messagev5.MessageType
+ Pktid uint16
+ Msgbuf []byte
+ Ackbuf []byte
+ OnComplete interface { }
}
}
namespace corev5.sessionsv5 {
class ackqueue {
- size int64
- mask int64
- count int64
- head int64
- tail int64
- ping ackmsg
- ring []ackmsg
- emap map[uint16]int64
- ackdone []ackmsg
- mu sync.Mutex
}
}
namespace corev5.sessionsv5 {
class memProvider {
- st map[string]Session
- mu sync.RWMutex
}
}
namespace corev5.sessionsv5 {
class session {
- pub1ack Ackqueue
- pub2in Ackqueue
- pub2out Ackqueue
- suback Ackqueue
- unsuback Ackqueue
- pingack Ackqueue
- cmsg *messagev5.ConnectMessage
- will *messagev5.PublishMessage
- retained *messagev5.PublishMessage
- cbuf []byte
- rbuf []byte
- topics map[string]byte
- initted bool
- mu sync.Mutex
- id string
}
}
namespace corev5.sessionsv5 {
class Manager {
- p SessionsProvider
}
}
namespace corev5.topicsv5 {
class memTopics {
- smu sync.RWMutex
- sroot *snode
- rmu sync.RWMutex
- rroot *rnode
- share share.ShareTopicsProvider
- sys sys.SysTopicsProvider
}
}
namespace corev5.topicsv5 {
class snode {
- subs []interface { }
- qos []byte
- snodes map[string]*snode
}
}
namespace corev5.topicsv5 {
class rnode {
- msg *messagev5.PublishMessage
- buf []byte
- rnodes map[string]*rnode
}
}
namespace corev5.topicsv5.share {
class memTopics {
- smu sync.RWMutex
- sroot *snode
- rmu sync.RWMutex
- rroot *rnode
}
}
namespace corev5.topicsv5.share {
class sins {
- subs []interface { }
- qos []byte
}
}
namespace corev5.topicsv5.share {
class snode {
- shares map[string]*sins
- snodes map[string]*snode
}
}
namespace corev5.topicsv5.share {
class rnode {
- msg *messagev5.PublishMessage
- buf []byte
- rnodes map[string]*rnode
}
}
namespace corev5.topicsv5.share {
class Manager {
- p ShareTopicsProvider
}
}
namespace corev5.topicsv5.sys {
class memTopics {
- smu sync.RWMutex
- sroot *rSnode
- rmu sync.RWMutex
- rroot *rRnode
}
}
namespace corev5.topicsv5.sys {
class rSnode {
- subs []interface { }
- qos []byte
- rsnodes map[string]*rSnode
}
}
namespace corev5.topicsv5.sys {
class rRnode {
- msg *messagev5.PublishMessage
- buf []byte
- rrnodes map[string]*rRnode
}
}
namespace corev5.topicsv5.sys {
class Manager {
- p SysTopicsProvider
}
}
namespace corev5.topicsv5 {
class Manager {
- p TopicsProvider
}
}
namespace logger {
class buffer {
- bytes.Buffer
- tmp []byte
- next *buffer
}
}
namespace logger.logs {
class AdamLog {
- zap *zap.Logger
+ *zap.SugaredLogger
}
}
namespace redis {
class Redis {
- rc redis.Conn
}
}
namespace redis {
class Group {
- sync.Mutex
- m map[string]*call
}
}
namespace redis {
class call {
- wg sync.WaitGroup
- val interface { }
- err error
- released bool
- dups int
- chans []chan Result
}
}
namespace redis {
class Result {
+ Val interface { }
+ Err error
+ Dups int
}
}
namespace redis {
class panicError {
- err string
}
}
namespace redis {
class runtimeError {
- err string
}
}
namespace redis {
class tn {
- v *ShareNameInfo
+ *time.Timer
}
}
namespace redis {
class cacheInfo {
- sync.RWMutex
- global
}
}
namespace redis {
class ShareNameInfo {
- sync.RWMutex
+ V map[string]map[string]int
- t map[string]int
}
}
namespace store.db {
class mysqlSessionStore {
- client *gorm.DB
}
}
namespace store.po {
class Pack {
+ Id uint64
+ ClientId string
+ PkId int
+ PTime int64
}
}
namespace store.po {
class PubMsg {
+ Id int64
+ ClientId string
+ PkId uint
+ MTypeFlags int
+ Topic string
+ PayloadFormatIndicator int8
+ MsgExpiryInterval uint64
+ TopicAlias uint
+ ResponseTopic string
+ CorrelationData string
+ UserProperty string
+ SubIdentifier int64
+ ContentType string
+ Payload string
+ PTime int64
}
}
namespace store.po {
class RetainMsg {
+ Id int64
+ ClientId string
+ PkId uint
+ MTypeFlags int
+ Topic string
+ PayloadFormatIndicator int8
+ MsgExpiryInterval uint64
+ TopicAlias uint
+ ResponseTopic string
+ CorrelationData string
+ UserProperty string
+ SubIdentifier int64
+ ContentType string
+ Payload string
+ RTime int64
}
}
namespace store.po {
class Sub {
+ Id uint64
+ ClientId string
+ Topic string
+ Qos uint8
+ SubIdentifier uint
+ STime int64
}
}
namespace store.po {
class WillMsg {
+ Id int64
+ ClientId string
+ PkId uint
+ MTypeFlags int
+ Topic string
+ PayloadFormatIndicator int8
+ MsgExpiryInterval uint64
+ TopicAlias uint
+ ResponseTopic string
+ CorrelationData string
+ UserProperty string
+ SubIdentifier int64
+ ContentType string
+ Payload string
+ OfflineTime int64
+ WTime int64
}
}
namespace store.po {
class Session {
+ Id uint64
+ ClientId string
+ Status uint8
+ OfflineTime int64
}
}
namespace core.auth {
interface Authenticator {
+ Authenticate(- id string,- cred interface { })- error
}
}
namespace core.cluster.share_topic {
interface ClusterShareTopicData {
+ GetData()- interface { }
+ SelectShare()- map[string][]string
}
}
namespace core.cluster.share_topic {
interface ShareTopic {
+ SubShare(- topic,shareName,nodeName string)- bool
+ UnSubShare(- topic,shareName,nodeName string)- bool
+ GetTopicShare(- topic string)(+ ClusterShareTopicData,- error)
+ DelTopic(- topic string)- error
+ DelNode(- old map[string][]string,- nodeName string)- error
}
}
namespace core.message {
interface Message {
+ Name()- string
+ Desc()- string
+ Type()+ MessageType
+ PacketId()- uint16
+ Encode(+ []byte)(- int,- error)
+ Decode(+ []byte)(- int,- error)
+ Len()- int
}
}
namespace core.service {
interface netReader {
+ SetReadDeadline(- t time.Time)- error
}
}
namespace core.sessions {
interface SessionsProvider {
+ New(- id string)(+ *Session,- error)
+ Get(- id string)(+ *Session,- error)
+ Del(- id string)
+ Save(- id string)- error
+ Count()- int
+ Close()- error
}
}
namespace core.topics.share {
interface ShareTopicsProvider {
+ Subscribe(- topic,shareName []byte,- qos byte,- subscriber interface { })(- byte,- error)
+ Unsubscribe(- topic,shareName []byte,- subscriber interface { })- error
+ Subscribers(- topic,shareName []byte,- qos byte,- subs *[]interface { },- qoss *[]byte)- error
+ AllSubInfo()(- map[string][]string,- error)
+ Retain(- msg *message.PublishMessage,- shareName []byte)- error
+ Retained(- topic,shareName []byte,- msgs *[]*message.PublishMessage)- error
+ Close()- error
}
}
namespace core.topics.sys {
interface SysTopicsProvider {
+ Subscribe(- topic []byte,- qos byte,- subscriber interface { })(- byte,- error)
+ Unsubscribe(- topic []byte,- subscriber interface { })- error
+ Subscribers(- topic []byte,- qos byte,- subs *[]interface { },- qoss *[]byte)- error
+ Retain(- msg *message.PublishMessage)- error
+ Retained(- topic []byte,- msgs *[]*message.PublishMessage)- error
+ Close()- error
}
}
namespace core.topics {
interface TopicsProvider {
+ Subscribe(- topic []byte,- qos byte,- subscriber interface { })(- byte,- error)
+ Unsubscribe(- topic []byte,- subscriber interface { })- error
+ Subscribers(- topic []byte,- qos byte,- subs *[]interface { },- qoss *[]byte,- svc bool,- shareName string,- onlyShare bool)- error
+ AllSubInfo()(- map[string][]string,- error)
+ Retain(- msg *message.PublishMessage)- error
+ Retained(- topic []byte,- msgs *[]*message.PublishMessage)- error
+ Close()- error
}
}
namespace corev5.authv5 {
interface Authenticator {
+ Authenticate(- id string,- cred interface { })- error
}
}
namespace corev5.authv5.authplus {
interface AuthPlus {
+ Verify(- authData []byte)(- d []byte,- continueAuth bool,- err error)
}
}
namespace corev5.messagev5 {
interface Message {
+ Name()- string
+ Desc()- string
+ Type()+ MessageType
+ PacketId()- uint16
+ Encode(+ []byte)(- int,- error)
+ Decode(+ []byte)(- int,- error)
+ Len()- int
}
}
namespace corev5.servicev5 {
interface netReader {
+ SetReadDeadline(- t time.Time)- error
}
}
namespace corev5.servicev5 {
interface netWriter {
+ SetWriteDeadline(- t time.Time)- error
}
}
namespace corev5.sessionsv5 {
interface Ackqueue {
+ Wait(- msg messagev5.Message,- onComplete interface { })- error
+ Ack(- msg messagev5.Message)- error
+ Acked()+ []ackmsg
+ SetCluserTag(- pktid uint16)- bool
+ Acked02()+ []ackmsg
}
}
namespace corev5.sessionsv5 {
interface Session {
+ Init(- msg *messagev5.ConnectMessage)- error
+ Update(- msg *messagev5.ConnectMessage)- error
+ RetainMessage(- msg *messagev5.PublishMessage)- error
+ AddTopic(- topic string,- qos byte)- error
+ RemoveTopic(- topic string)- error
+ Topics()(+ []string,+ []byte,- error)
+ ID()- string
+ IDs()+ []byte
+ Cmsg()+ *messagev5.ConnectMessage
+ Will()+ *messagev5.PublishMessage
+ Retained()+ *messagev5.PublishMessage
+ Pub1ack()+ Ackqueue
+ Pub2in()+ Ackqueue
+ Pub2out()+ Ackqueue
+ Suback()+ Ackqueue
+ Unsuback()+ Ackqueue
+ Pingack()+ Ackqueue
}
}
namespace corev5.sessionsv5 {
interface SessionsProvider {
+ New(- id string)(+ Session,- error)
+ Get(- id string)(+ Session,- error)
+ Del(- id string)
+ Save(- id string)- error
+ Count()- int
+ Close()- error
}
}
namespace corev5.topicsv5.share {
interface ShareTopicsProvider {
+ Subscribe(- topic,shareName []byte,- qos byte,- subscriber interface { })(- byte,- error)
+ Unsubscribe(- topic,shareName []byte,- subscriber interface { })- error
+ Subscribers(- topic,shareName []byte,- qos byte,- subs *[]interface { },- qoss *[]byte)- error
+ AllSubInfo()(- map[string][]string,- error)
+ Retain(- msg *messagev5.PublishMessage,- shareName []byte)- error
+ Retained(- topic,shareName []byte,- msgs *[]*messagev5.PublishMessage)- error
+ Close()- error
}
}
namespace corev5.topicsv5.sys {
interface SysTopicsProvider {
+ Subscribe(- topic []byte,- qos byte,- subscriber interface { })(- byte,- error)
+ Unsubscribe(- topic []byte,- subscriber interface { })- error
+ Subscribers(- topic []byte,- qos byte,- subs *[]interface { },- qoss *[]byte)- error
+ Retain(- msg *messagev5.PublishMessage)- error
+ Retained(- topic []byte,- msgs *[]*messagev5.PublishMessage)- error
+ Close()- error
}
}
namespace corev5.topicsv5 {
interface TopicsProvider {
+ Subscribe(- topic []byte,- qos byte,- subscriber interface { })(- byte,- error)
+ Unsubscribe(- topic []byte,- subscriber interface { })- error
+ Subscribers(- topic []byte,- qos byte,- subs *[]interface { },- qoss *[]byte,- svc bool,- shareName string,- onlyShare bool)- error
+ AllSubInfo()(- map[string][]string,- error)
+ Retain(- msg *messagev5.PublishMessage)- error
+ Retained(- topic []byte,- msgs *[]*messagev5.PublishMessage)- error
+ Close()- error
}
}
namespace store {
interface MessageStore {
+ Start(- config config.SIConfig)- error
+ Stop()- error
+ StoreWillMessage(- clientId string,- message messagev5.Message)- error
+ ClearWillMessage(- clientId string)- error
+ GetWillMessage(- clientId string)(- messagev5.Message,- error)
+ StoreRetainMessage(- topic string,- message messagev5.Message)- error
+ ClearRetainMessage(- topic string)- error
+ GetRetainMessage(- topic string)(- messagev5.Message,- error)
+ GetAllRetainMsg()(+ []messagev5.Message,- error)
}
}
namespace store {
interface SessionStore {
+ Start(- config config.SIConfig)- error
+ Stop()- error
+ GetSession(- clientId string)(- model.Session,- error)
+ StoreSession(- clientId string,- session model.Session)- error
+ ClearSession(- clientId string,- clearOfflineMsg bool)- error
+ StoreSubscription(- clientId string,- subscription model.Subscription)- error
+ DelSubscription(- client,topic string)- error
+ ClearSubscription(- clientId string)- error
+ GetSubscriptions(- clientId string)(+ []model.Subscription,- error)
+ CacheInflowMsg(- clientId string,- message messagev5.Message)- error
+ ReleaseInflowMsg(- clientId string,- msgId int64)(- messagev5.Message,- error)
+ GetAllInflowMsg(- clientId string)(+ []messagev5.Message,- error)
+ CacheOutflowMsg(- client string,- message messagev5.Message)- error
+ GetAllOutflowMsg(- clientId string)(- messagev5.Message,- error)
+ ReleaseOutflowMsg(- clientId string,- msgId int64)(- messagev5.Message,- error)
+ CacheOutflowSecMsgId(- clientId string,- msgId int64)- error
+ GetAllOutflowSecMsg(- clientId string)(+ []int64,- error)
+ ReleaseOutflowSecMsgId(- clientId string,- msgId int64)- error
+ StoreOfflineMsg(- clientId string,- message messagev5.Message)- error
+ GetAllOfflineMsg(- clientId string)(+ []messagev5.Message,- error)
+ ClearOfflineMsgs(- clientId string)- error
+ ClearOfflineMsgById(- clientId string,- msgIds []int64)- error
}
}
config.SIConfig ---> config.Log : + Log
config.SIConfig ---> config.Broker : + Broker
config.SIConfig ---> config.Cluster : + Cluster
config.SIConfig ---> config.DefaultConfig : + DefaultConfig
config.SIConfig ---> config.Store : + Store
config.SIConfig ---> config.PProf : + PProf
config.DefaultConfig ---> config.Connect : + Connect
config.DefaultConfig ---> config.Provider : + Provider
config.DefaultConfig ---> config.Auth : + Auth
config.DefaultConfig ---> config.Server : + Server
config.Store ---> config.Mysql : + Mysql
config.Store ---> config.Redis : + Redis
core.message.ConnackMessage -||> core.message.header
core.message.ConnectMessage -||> core.message.header
core.message.DisconnectMessage -||> core.message.header
core.message.PingreqMessage -||> core.message.DisconnectMessage
core.message.PingrespMessage -||> core.message.DisconnectMessage
core.message.PubackMessage -||> core.message.header
core.message.PubcompMessage -||> core.message.PubackMessage
core.message.PublishMessage -||> core.message.header
core.message.PubrecMessage -||> core.message.PubackMessage
core.message.PubrelMessage -||> core.message.PubackMessage
core.message.SubackMessage -||> core.message.header
core.message.SubscribeMessage -||> core.message.header
core.message.UnsubackMessage -||> core.message.PubackMessage
core.message.UnsubscribeMessage -||> core.message.header
core.service.buffer ---> core.service.sequence : - pseq
core.service.buffer ---> core.service.sequence : - cseq
core.service.Server ---> "*" core.service.service : - svcs
core.service.service ---> core.service.buffer : - in
core.service.service ---> core.service.buffer : - out
core.service.service ---> core.service.stat : - inStat
core.service.service ---> core.service.stat : - outStat
core.sessions.Ackqueue ---> core.sessions.ackmsg : - ping
core.sessions.Ackqueue ---> "*" core.sessions.ackmsg : - ring
core.sessions.Ackqueue ---> "*" core.sessions.ackmsg : + ackdone
core.sessions.memProvider ---> "*" core.sessions.Session : - st
core.sessions.Session ---> core.sessions.Ackqueue : + Pub1ack
core.sessions.Session ---> core.sessions.Ackqueue : + Pub2in
core.sessions.Session ---> core.sessions.Ackqueue : + Pub2out
core.sessions.Session ---> core.sessions.Ackqueue : + Suback
core.sessions.Session ---> core.sessions.Ackqueue : + Unsuback
core.sessions.Session ---> core.sessions.Ackqueue : + Pingack
core.topics.memTopics ---> core.topics.snode : - sroot
core.topics.memTopics ---> core.topics.rnode : - rroot
core.topics.snode ---> "*" core.topics.snode : - snodes
core.topics.rnode ---> "*" core.topics.rnode : - rnodes
core.topics.share.memTopics ---> core.topics.share.snode : - sroot
core.topics.share.memTopics ---> core.topics.share.rnode : - rroot
core.topics.share.snode ---> "*" core.topics.share.sins : - shares
core.topics.share.snode ---> "*" core.topics.share.snode : - snodes
core.topics.share.rnode ---> "*" core.topics.share.rnode : - rnodes
core.topics.sys.memTopics ---> core.topics.sys.rSnode : - sroot
core.topics.sys.memTopics ---> core.topics.sys.rRnode : - rroot
core.topics.sys.rSnode ---> "*" core.topics.sys.rSnode : - rsnodes
core.topics.sys.rRnode ---> "*" core.topics.sys.rRnode : - rrnodes
corev5.messagev5.AuthMessage -||> corev5.messagev5.header
corev5.messagev5.ConnackMessage -||> corev5.messagev5.header
corev5.messagev5.ConnectMessage -||> corev5.messagev5.header
corev5.messagev5.DisconnectMessage -||> corev5.messagev5.header
corev5.messagev5.PingreqMessage -||> corev5.messagev5.header
corev5.messagev5.PingrespMessage -||> corev5.messagev5.header
corev5.messagev5.PubackMessage -||> corev5.messagev5.header
corev5.messagev5.PubcompMessage -||> corev5.messagev5.PubackMessage
corev5.messagev5.PublishMessage -||> corev5.messagev5.header
corev5.messagev5.PubrecMessage -||> corev5.messagev5.PubackMessage
corev5.messagev5.PubrelMessage -||> corev5.messagev5.PubackMessage
corev5.messagev5.SubackMessage -||> corev5.messagev5.header
corev5.messagev5.SubscribeMessage -||> corev5.messagev5.header
corev5.messagev5.UnsubackMessage -||> corev5.messagev5.header
corev5.messagev5.UnsubscribeMessage -||> corev5.messagev5.header
corev5.servicev5.buffer ---> corev5.servicev5.sequence : - pseq
corev5.servicev5.buffer ---> corev5.servicev5.sequence : - cseq
corev5.servicev5.Client ---> corev5.servicev5.service : - svc
corev5.servicev5.Server ---> "*" corev5.servicev5.service : - svcs
corev5.servicev5.service ---> corev5.servicev5.buffer : - in
corev5.servicev5.service ---> corev5.servicev5.buffer : - out
corev5.servicev5.service ---> corev5.servicev5.stat : - inStat
corev5.servicev5.service ---> corev5.servicev5.stat : - outStat
corev5.sessionsv5.ackqueue ---> corev5.sessionsv5.ackmsg : - ping
corev5.sessionsv5.ackqueue ---> "*" corev5.sessionsv5.ackmsg : - ring
corev5.sessionsv5.ackqueue ---> "*" corev5.sessionsv5.ackmsg : + ackdone
corev5.topicsv5.memTopics ---> corev5.topicsv5.snode : - sroot
corev5.topicsv5.memTopics ---> corev5.topicsv5.rnode : - rroot
corev5.topicsv5.snode ---> "*" corev5.topicsv5.snode : - snodes
corev5.topicsv5.rnode ---> "*" corev5.topicsv5.rnode : - rnodes
corev5.topicsv5.share.memTopics ---> corev5.topicsv5.share.snode : - sroot
corev5.topicsv5.share.memTopics ---> corev5.topicsv5.share.rnode : - rroot
corev5.topicsv5.share.snode ---> "*" corev5.topicsv5.share.sins : - shares
corev5.topicsv5.share.snode ---> "*" corev5.topicsv5.share.snode : - snodes
corev5.topicsv5.share.rnode ---> "*" corev5.topicsv5.share.rnode : - rnodes
corev5.topicsv5.sys.memTopics ---> corev5.topicsv5.sys.rSnode : - sroot
corev5.topicsv5.sys.memTopics ---> corev5.topicsv5.sys.rRnode : - rroot
corev5.topicsv5.sys.rSnode ---> "*" corev5.topicsv5.sys.rSnode : - rsnodes
corev5.topicsv5.sys.rRnode ---> "*" corev5.topicsv5.sys.rRnode : - rrnodes
logger.buffer ---> logger.buffer : - next
redis.Group ---> "*" redis.call : - m
redis.tn ---> redis.ShareNameInfo : - v
core.auth.Authenticator <|.. core.auth.Manager
core.auth.Authenticator <|.. corev5.authv5.Manager
core.sessions.SessionsProvider <|.. core.sessions.memProvider
core.sessions.SessionsProvider <|.. core.sessions.Manager
core.topics.share.ShareTopicsProvider <|.. core.topics.share.memTopics
core.topics.share.ShareTopicsProvider <|.. core.topics.share.Manager
core.topics.sys.SysTopicsProvider <|.. core.topics.sys.memTopics
core.topics.sys.SysTopicsProvider <|.. core.topics.sys.Manager
core.topics.TopicsProvider <|.. core.topics.memTopics
core.topics.TopicsProvider <|.. core.topics.Manager
corev5.authv5.Authenticator <|.. core.auth.Manager
corev5.authv5.Authenticator <|.. corev5.authv5.Manager
corev5.authv5.authplus.AuthPlus <|.. corev5.authv5.authplus.Manager
corev5.authv5.authplus.AuthPlus <|.. corev5.authv5.authplus.defaultAuth
corev5.sessionsv5.Ackqueue <|.. corev5.sessionsv5.ackqueue
corev5.sessionsv5.Session <|.. corev5.sessionsv5.session
corev5.sessionsv5.SessionsProvider <|.. corev5.sessionsv5.memProvider
corev5.sessionsv5.SessionsProvider <|.. corev5.sessionsv5.Manager
corev5.topicsv5.share.ShareTopicsProvider <|.. corev5.topicsv5.share.memTopics
corev5.topicsv5.share.ShareTopicsProvider <|.. corev5.topicsv5.share.Manager
corev5.topicsv5.sys.SysTopicsProvider <|.. corev5.topicsv5.sys.memTopics
corev5.topicsv5.sys.SysTopicsProvider <|.. corev5.topicsv5.sys.Manager
corev5.topicsv5.TopicsProvider <|.. corev5.topicsv5.memTopics
corev5.topicsv5.TopicsProvider <|.. corev5.topicsv5.Manager
store.SessionStore <|.. store.db.mysqlSessionStore
core.auth.Manager ---> core.auth.Authenticator : - p
core.service.timeoutReader ---> core.service.netReader : - conn
core.sessions.Manager ---> core.sessions.SessionsProvider : - p
core.topics.share.Manager ---> core.topics.share.ShareTopicsProvider : - p
core.topics.sys.Manager ---> core.topics.sys.SysTopicsProvider : - p
core.topics.Manager ---> core.topics.TopicsProvider : - p
corev5.authv5.Manager ---> corev5.authv5.Authenticator : - p
corev5.authv5.authplus.Manager ---> corev5.authv5.authplus.AuthPlus : - p
corev5.servicev5.timeoutWriter ---> corev5.servicev5.netWriter : - conn
corev5.servicev5.timeoutReader ---> corev5.servicev5.netReader : - conn
corev5.sessionsv5.Manager ---> corev5.sessionsv5.SessionsProvider : - p
corev5.topicsv5.share.Manager ---> corev5.topicsv5.share.ShareTopicsProvider : - p
corev5.topicsv5.sys.Manager ---> corev5.topicsv5.sys.SysTopicsProvider : - p
corev5.topicsv5.Manager ---> corev5.topicsv5.TopicsProvider : - p
@enduml
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/Ljolan/si-mqtt.git
[email protected]:Ljolan/si-mqtt.git
Ljolan
si-mqtt
SI-MQTT
dev-v2-sample

搜索帮助