Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(prefix string, opts *mqtt_client.MqttClientOptions) error
Types ¶
type BindItem ¶
type BindItem[I any, O any] struct { Topic string // 请求路径 ResponseIdentifier response.Identifier // 响应标识符提供接口,会在响应主题添加该标识符 ResponseFunc response.SendFunc[O] // 响应泛型函数 BusinessFunc BusinessFunc[I, O] // 业务泛型函数 OptionalBindingFunc BindingFunc[O] // 可选的绑定函数 }
BindItem 路由条目结构
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
func NewBinding ¶
func NewBinding(apiVersion string, responseIdentifier response.Identifier, handlers ...router.Handler) *Binding
NewBinding 创建版本对应的binding
type BindingFunc ¶
type BindingFunc[O any] func(c *mqtt_client.MqttClient, item *router.Item, request any, sendFunc response.SendFunc[O]) bool
type BusinessFunc ¶
type BusinessFunc[I any, O any] func(c *mqtt_client.MqttClient, inputModel I) (O, error)
Click to show internal directories.
Click to hide internal directories.