Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOverflow = errors.New("session: overflow") ErrPersistence = errors.New("session: error during persistence restore") )
nolint: golint
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct {
// OnStop called when session stopped net connection and should be either suspended or deleted
OnStop func(string, bool)
}
Callbacks provided by sessions manager to signal session state
type Config ¶
type Config struct {
*PreConfig
ID string
Subscriber subscriber.ConnectionProvider
Messenger types.TopicMessenger
OnDisconnect onDisconnect
ExpireIn *uint32
WillDelay uint32
KillOnDisconnect bool
}
Config is system wide configuration parameters for every session
type DisconnectParams ¶
type DisconnectParams struct {
ExpireAt *uint32
Desc *netpoll.Desc
Reason packet.ReasonCode
Will bool
}
DisconnectParams session state when stopped
type PreConfig ¶
type PreConfig struct {
EventPoll netpoll.EventPoll
Username string
AuthMethod string
AuthData []byte
PersistedSession persistence.Sessions
Metric systree.Metric
Conn net.Conn
Auth auth.SessionPermissions
Desc *netpoll.Desc
MaxRxPacketSize uint32
MaxTxPacketSize uint32
SendQuota int32
MaxTxTopicAlias uint16
MaxRxTopicAlias uint16
KeepAlive uint16
Version packet.ProtocolVersion
RetainAvailable bool
PreserveOrder bool
OfflineQoS0 bool
}
PreConfig used by session manager to when configuring session a bit of ugly TODO(troian): try rid it off
type Type ¶
type Type struct {
*Config
// contains filtered or unexported fields
}
Type connection
func (*Type) Stop ¶
func (s *Type) Stop(reason packet.ReasonCode)
Stop session. Function assumed to be invoked once server about to either shutdown, disconnect or session is being replaced Effective only first invoke
Click to show internal directories.
Click to hide internal directories.