broker

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 15 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 interface{}, 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
	LazyMsgSend  int
	NilConnDeny  int
	BlockTime    int
	MaxAttempts  int
	IpBlocker    *ipblocker.Blocker // 增加Blocker字段
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() *Engine

func (*Engine) AddClient

func (e *Engine) AddClient(conn interface{}, tlsConn *tls.Conn) *Client

func (*Engine) Close

func (e *Engine) Close()

func (*Engine) DelClient

func (e *Engine) DelClient(conn interface{})

func (*Engine) GetClient

func (e *Engine) GetClient(conn interface{}) (*Client, bool)

func (*Engine) InitIpBlocker added in v1.0.3

func (e *Engine) InitIpBlocker()

Jump to

Keyboard shortcuts

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