mqtt

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "mqtt"

Type 组件类型

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint added in v0.17.0

type Endpoint = Mqtt

Endpoint 别名

type Mqtt

type Mqtt struct {
	endpoint.BaseEndpoint
	RuleConfig types.Config
	Config     mqtt.Config
	// contains filtered or unexported fields
}

Mqtt MQTT 接收端端点

func (*Mqtt) AddRouter

func (m *Mqtt) AddRouter(router *endpoint.Router, params ...interface{}) (string, error)

func (*Mqtt) Close

func (m *Mqtt) Close() error

func (*Mqtt) Destroy added in v0.14.0

func (m *Mqtt) Destroy()

Destroy 销毁

func (*Mqtt) Id added in v0.14.0

func (m *Mqtt) Id() string

func (*Mqtt) Init added in v0.14.0

func (m *Mqtt) Init(ruleConfig types.Config, configuration types.Configuration) error

Init 初始化

func (*Mqtt) New added in v0.14.0

func (m *Mqtt) New() types.Node

func (*Mqtt) Printf added in v0.14.0

func (m *Mqtt) Printf(format string, v ...interface{})

func (*Mqtt) RemoveRouter added in v0.17.0

func (m *Mqtt) RemoveRouter(routerId string, params ...interface{}) error

func (*Mqtt) Start

func (m *Mqtt) Start() error

func (*Mqtt) Type added in v0.14.0

func (m *Mqtt) Type() string

Type 组件类型

type RequestMessage

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

RequestMessage http请求消息

func (*RequestMessage) Body

func (r *RequestMessage) Body() []byte

Body 获取请求体

func (*RequestMessage) From

func (r *RequestMessage) From() string

From 获取主题

func (*RequestMessage) GetError added in v0.15.0

func (r *RequestMessage) GetError() error

func (*RequestMessage) GetMsg

func (r *RequestMessage) GetMsg() *types.RuleMsg

func (*RequestMessage) GetParam

func (r *RequestMessage) GetParam(key string) string

GetParam 不提供获取参数

func (*RequestMessage) Headers

func (r *RequestMessage) Headers() textproto.MIMEHeader

func (*RequestMessage) Request

func (r *RequestMessage) Request() paho.Message

func (*RequestMessage) SetBody

func (r *RequestMessage) SetBody(body []byte)

SetBody 设置消息体

func (*RequestMessage) SetError added in v0.15.0

func (r *RequestMessage) SetError(err error)

func (*RequestMessage) SetMsg

func (r *RequestMessage) SetMsg(msg *types.RuleMsg)

func (*RequestMessage) SetStatusCode

func (r *RequestMessage) SetStatusCode(statusCode int)

SetStatusCode 不提供设置状态码

type ResponseMessage

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

ResponseMessage http响应消息

func (*ResponseMessage) Body

func (r *ResponseMessage) Body() []byte

func (*ResponseMessage) From

func (r *ResponseMessage) From() string

func (*ResponseMessage) GetError added in v0.15.0

func (r *ResponseMessage) GetError() error

func (*ResponseMessage) GetMsg

func (r *ResponseMessage) GetMsg() *types.RuleMsg

func (*ResponseMessage) GetParam

func (r *ResponseMessage) GetParam(key string) string

GetParam 不提供获取参数

func (*ResponseMessage) Headers

func (r *ResponseMessage) Headers() textproto.MIMEHeader

func (*ResponseMessage) Response

func (r *ResponseMessage) Response() paho.Client

func (*ResponseMessage) SetBody

func (r *ResponseMessage) SetBody(body []byte)

func (*ResponseMessage) SetError added in v0.15.0

func (r *ResponseMessage) SetError(err error)

func (*ResponseMessage) SetMsg

func (r *ResponseMessage) SetMsg(msg *types.RuleMsg)

func (*ResponseMessage) SetStatusCode

func (r *ResponseMessage) SetStatusCode(statusCode int)

Jump to

Keyboard shortcuts

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