broker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientID string

	Subscribed *topic.Tree

	Cache bytes.Buffer
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn *pollio.Conn, eng *Engine) *Client

func (*Client) Clear

func (c *Client) Clear()

func (*Client) ClearWill

func (c *Client) ClearWill()

func (*Client) Close

func (c *Client) Close()

func (*Client) Receive

func (c *Client) Receive(pkt packet.Generic) (err error)

func (*Client) TickFunc

func (c *Client) TickFunc()

func (*Client) Wills

func (c *Client) Wills()

type Engine

type Engine struct {
	Subscribed   *topic.Tree
	Retained     *sync.Map
	Clients      *sync.Map
	Qos1Store    *multimap.MultiMap
	Qos2PubStore *multimap.MultiMap
	Qos2RelStore *multimap.MultiMap

	JwtSecretKey [][]byte
	SelfDdosDeny int
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() *Engine

func (*Engine) AddClient

func (e *Engine) AddClient(conn *pollio.Conn, tlsConn *tls.Conn) *Client

func (*Engine) Close

func (e *Engine) Close()

func (*Engine) DelClient

func (e *Engine) DelClient(conn *pollio.Conn)

func (*Engine) GetClient

func (e *Engine) GetClient(conn *pollio.Conn) (*Client, bool)

Jump to

Keyboard shortcuts

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