Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrReplaceNotAllowed case when new client with existing ID connected ErrReplaceNotAllowed = errors.New("duplicate not allowed") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Topics manager for all the client subscriptions TopicsMgr topicsTypes.Provider Persist persistenceTypes.Provider Systree systree.Provider // OnReplaceAttempt If requested we notify if there is attempt to dup session OnReplaceAttempt func(string, bool) NodeName string // The number of seconds to wait for the CONNACK message before disconnecting. // If not set then default to 2 seconds. ConnectTimeout int // The number of seconds to keep the connection live if there's no data. // If not set then defaults to 5 minutes. KeepAlive int // AllowReplace Either allow or deny replacing of existing session if there new client with same clientID AllowReplace bool OfflineQoS0 bool }
Config manager configuration
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager clients manager
func NewManager ¶
NewManager create new clients manager
func (*Manager) NewSession ¶
func (m *Manager) NewSession(config *StartConfig)
NewSession create new session with provided established connection This is god function. Might be try split it
type StartConfig ¶
type StartConfig struct { Req *packet.Connect Resp *packet.ConnAck Conn net.Conn Auth auth.SessionPermissions }
StartConfig used to configure session after connection is created
Click to show internal directories.
Click to hide internal directories.