clients

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TopicsMgr                     topicsTypes.Provider
	Persist                       persistence.Provider
	Systree                       systree.Provider
	OnReplaceAttempt              func(string, bool)
	NodeName                      string
	ConnectTimeout                int
	KeepAlive                     int
	MaxPacketSize                 uint32
	ReceiveMax                    uint16
	TopicAliasMaximum             uint16
	MaximumQoS                    packet.QosType
	AvailableRetain               bool
	AvailableWildcardSubscription bool
	AvailableSubscriptionID       bool
	AvailableSharedSubscription   bool
	OfflineQoS0                   bool
	AllowReplace                  bool
	ForceKeepAlive                bool
	PersistUseBuffer              bool
	PersistBufferSyncInterval     uint64
	MaxSessionCount               int64
}

Config manager configuration

type Manager

type Manager struct {
	Config
	// contains filtered or unexported fields
}

Manager clients manager

func NewManager

func NewManager(c *Config) (*Manager, error)

NewManager create new clients manager

func (*Manager) KickOff added in v0.0.4

func (m *Manager) KickOff(clientID string) error

func (*Manager) ListAllClients added in v0.0.4

func (m *Manager) ListAllClients(handle func(id string, remote string, clean bool, user string, create string, topics map[string]byte)) error

func (*Manager) ListOneClient added in v0.0.4

func (m *Manager) ListOneClient(id string, handle func(id string, remote string, clean bool, user string, create string, subTopics map[string]byte)) error

func (*Manager) NewSession

func (m *Manager) NewSession(config *StartConfig) (err error)

NewSession create new session with provided established connection This is god function. Might be try split it

func (*Manager) Shutdown

func (m *Manager) Shutdown() error

Shutdown clients manager gracefully shutdown by stopping all active sessions and persist states

type StartConfig

type StartConfig struct {
	Req  *packet.Connect
	Resp *packet.ConnAck
	Conn net.Conn
	Auth auth.SessionPermissions
}

StartConfig used to reconfigure session after connection is created

Jump to

Keyboard shortcuts

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