session

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

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, message.ProtocolVersion, *persistenceTypes.SessionState)
}

Callbacks provided by sessions manager to signal session state

type Config

type Config struct {
	ID          string
	State       persistenceTypes.Session
	Subscriber  subscriber.SessionProvider
	Messenger   types.TopicMessenger
	Conn        io.Closer
	Metric      systree.Metric
	Callbacks   *Callbacks
	Will        *message.PublishMessage
	KeepAlive   int
	SendQuota   int32
	OfflineQoS0 bool
	Clean       bool
	Version     message.ProtocolVersion
}

Config is system wide configuration parameters for every session

type Type

type Type struct {
	// contains filtered or unexported fields
}

Type session

func New

func New(config *Config) (s *Type, present bool, err error)

New allocate new sessions object

func (*Type) Start

func (s *Type) Start()

Start signal session to start processing messages. Effective only first invoke

func (*Type) Stop

func (s *Type) Stop()

Stop session. Function assumed to be invoked once server about to shutdown or session is being replaced Effective only first invoke

type WillConfig

type WillConfig struct {
	Topic   string
	Message []byte
	Retain  bool
	QoS     message.QosType
}

WillConfig configures session for will messages

Jump to

Keyboard shortcuts

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