Versions in this module Expand all Collapse all v0 v0.0.2 Sep 13, 2021 Changes in this version + var Default = "default" + var ErrKeyNotAvailable = errors.New("Session: not item found for key.") + var ErrSessionsProviderNotFound = errors.New("Session: Session provider not found") + func Register(name string, provider SessionsProvider) + func SessionInit(session string) + func Unregister(name string) + type Ackmsg struct + Ackbuf []byte + Msgbuf []byte + Mtype messagev5.MessageType + OnComplete interface{} + Pktid uint16 + State messagev5.MessageType + type Ackqueue interface + Ack func(msg messagev5.Message) error + Acked func() []Ackmsg + Wait func(msg messagev5.Message, onComplete interface{}) error + type Manager struct + func NewManager(providerName string) (*Manager, error) + func (this *Manager) Close() error + func (this *Manager) Count() int + func (this *Manager) Del(id string) + func (this *Manager) Get(id string, cleanStart bool) (Session, error) + func (this *Manager) New(id string, cleanStart bool) (Session, error) + func (this *Manager) Save(id string) error + type Session interface + AddTopic func(topic string, qos byte) error + Cmsg func() *messagev5.ConnectMessage + ID func() string + IDs func() []byte + Init func(msg *messagev5.ConnectMessage, topics ...SessionInitTopic) error + Pingack func() Ackqueue + Pub1ack func() Ackqueue + Pub2in func() Ackqueue + Pub2out func() Ackqueue + RemoveTopic func(topic string) error + Suback func() Ackqueue + Topics func() ([]string, []byte, error) + Unsuback func() Ackqueue + Update func(msg *messagev5.ConnectMessage) error + Will func() *messagev5.PublishMessage + type SessionExpand interface + ClientId func() string + ExpiryInterval func() uint32 + MaxPacketSize func() uint32 + OfflineTime func() int64 + ReceiveMaximum func() uint16 + RequestProblemInfo func() byte + RequestRespInfo func() byte + SetClientId func(string) + SetExpiryInterval func(uint32) + SetMaxPacketSize func(uint32) + SetOfflineTime func(int64) + SetReceiveMaximum func(uint16) + SetRequestProblemInfo func(byte) + SetRequestRespInfo func(byte) + SetStatus func(Status) + SetSub func(*messagev5.SubscribeMessage) + SetTopicAliasMax func(uint16) + SetUserProperty func([]string) + SetWill func(*messagev5.PublishMessage) + Status func() Status + TopicAliasMax func() uint16 + UserProperty func() []string + type SessionInitTopic struct + Qos byte + Topic string + type SessionsProvider interface + Close func() error + Count func() int + Del func(id string) + Get func(id string, cleanStart bool) (Session, error) + New func(id string, cleanStart bool) (Session, error) + Save func(id string) error + type Status uint8 + const NULL + const OFFLINE + const ONLINE