session

package
v0.0.0-...-f0a05f1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryStore

func NewMemoryStore(config *Config, f func(*packets.PublishPacket), df func(interface{})) *memoryStore

Types

type Config

type Config struct {
	ZQueueLen      int
	OTQueueLen     int
	Inflight       int
	PeerZQueueLen  int
	PeerOTQueueLen int
	PeerInflight   int
}

type IStore

type IStore interface {
	Count() int

	GetOrCreate(id string, connID string, peer bool) (*Session, bool, error)

	RemoveAndCreate(id string, connID string, peer bool) (*Session, error)

	Remove(id string, connID string) error
}

type Session

type Session struct {

	// for qos 0
	ZQueue    *list.List
	ZQueueLen int
	// for qos 1, 2
	OTQueue    *list.List
	OTQueueLen int
	// contains filtered or unexported fields
}

func (*Session) AddTopic

func (s *Session) AddTopic(topic string, qos byte) error

func (*Session) ConnID

func (s *Session) ConnID() string

func (*Session) Free

func (s *Session) Free()

func (*Session) ID

func (s *Session) ID() string

func (*Session) Inflight

func (s *Session) Inflight() ipq.IPQ

func (*Session) PushBackOT

func (s *Session) PushBackOT(packet *packets.PublishPacket)

func (*Session) PushBackZ

func (s *Session) PushBackZ(packet *packets.PublishPacket)

func (*Session) RemoveTopic

func (s *Session) RemoveTopic(topic string) error

func (*Session) Topics

func (s *Session) Topics() ([]string, []byte, error)

func (*Session) UpdateConnID

func (s *Session) UpdateConnID(connID string)

Jump to

Keyboard shortcuts

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