broker

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Server *mochi.Server

Functions

func CustomOpenConnectionFn added in v4.1.1

func CustomOpenConnectionFn(uri *url.URL, options paho.ClientOptions) (net.Conn, error)

func GinBridge

func GinBridge(ctx *gin.Context)

func Shutdown added in v4.1.0

func Shutdown() (err error)

func Startup added in v4.1.0

func Startup() error

Types

type Auth added in v4.1.0

type Auth struct {
	mqtt.HookBase
}

func (*Auth) ID added in v4.1.0

func (h *Auth) ID() string

ID returns the ID of the hook.

func (*Auth) OnACLCheck added in v4.1.0

func (h *Auth) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

OnACLCheck returns true/allowed for all checks.

func (*Auth) OnConnectAuthenticate added in v4.1.0

func (h *Auth) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

OnConnectAuthenticate returns true/allowed for all requests.

func (*Auth) Provides added in v4.1.0

func (h *Auth) Provides(b byte) bool

Provides indicates which hook methods this hook provides.

type Broker added in v4.0.18

type Broker struct {
	Id          string    `json:"id" xorm:"pk"`
	Name        string    `json:"name"`
	Description string    `json:"description,omitempty"`
	Port        int       `json:"port,omitempty"` //TODO 添加TLS证书
	Disabled    bool      `json:"disabled,omitempty"`
	Created     time.Time `json:"created,omitempty" xorm:"created"`
}

type Gateway added in v4.0.18

type Gateway struct {
	Id          string `json:"id" xorm:"pk"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`

	Disabled bool      `json:"disabled,omitempty"`
	Created  time.Time `json:"created,omitempty" xorm:"created"`
}

Jump to

Keyboard shortcuts

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