listener

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2018 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionDisconnected = errors.New("session disconnected")
)

Functions

func New

func New(handler Handler, inflightSize int) (io.Closer, chan<- Transport)

Types

type Handler

type Handler interface {
	Authenticate(transport Transport, sessionID, username string, password string) (tenant string, id string, err error)
	OnConnect(sess *Session)
}

type Session

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

func (*Session) Close

func (s *Session) Close() error

func (*Session) ConnAck added in v0.0.9

func (s *Session) ConnAck(returnCode int32) error

func (*Session) Connect

func (s *Session) Connect() *packet.Connect

func (*Session) ID added in v0.0.9

func (s *Session) ID() string

func (*Session) OnClosed added in v0.0.9

func (s *Session) OnClosed(f func()) func()

func (*Session) OnLost added in v0.0.9

func (s *Session) OnLost(f func()) func()

func (*Session) OnPublish added in v0.0.9

func (s *Session) OnPublish(f func(packet *packet.Publish)) func()

func (*Session) OnSubscribe added in v0.0.9

func (s *Session) OnSubscribe(f func(packet *packet.Subscribe)) func()

func (*Session) OnUnsubscribe added in v0.0.9

func (s *Session) OnUnsubscribe(f func(packet *packet.Unsubscribe)) func()

func (*Session) PubAck added in v0.0.9

func (s *Session) PubAck(mid int32) error

func (*Session) Publish added in v0.0.9

func (s *Session) Publish(p *packet.Publish) error

func (*Session) RemoteAddress added in v0.0.10

func (s *Session) RemoteAddress() string

func (*Session) SubAck added in v0.0.9

func (s *Session) SubAck(mid int32, grantedQoS []int32) error

func (*Session) Tenant added in v0.0.9

func (s *Session) Tenant() string

func (*Session) TransportName added in v0.0.9

func (s *Session) TransportName() string

type TimeoutReadWriteCloser

type TimeoutReadWriteCloser interface {
	SetDeadline(time.Time) error
	io.ReadWriteCloser
}

type Transport

type Transport interface {
	io.Closer
	Name() string
	Encrypted() bool
	EncryptionState() *tls.ConnectionState
	Channel() TimeoutReadWriteCloser
	RemoteAddress() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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