handler

package
v0.0.0-...-67d91c4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceViewTopic

func DeviceViewTopic(w http.ResponseWriter, r *http.Request)

查询设备订阅的topic

func GetDeviceId

func GetDeviceId(w http.ResponseWriter, r *http.Request)

获取一个随机id, 可以作为设备id使用

func Hello

func Hello(w http.ResponseWriter, r *http.Request)

func Publish

func Publish(w http.ResponseWriter, r *http.Request)

func Subscription

func Subscription(w http.ResponseWriter, r *http.Request)

设备订阅, 支持批量

func TopicAllDevice

func TopicAllDevice(w http.ResponseWriter, r *http.Request)

查询topic被哪些设备订阅

func TopicCancel

func TopicCancel(w http.ResponseWriter, r *http.Request)

设备取消订阅, 支持批量

func TopicCheckDevice

func TopicCheckDevice(w http.ResponseWriter, r *http.Request)

查询topic是否被指定device订阅

func TopicCreate

func TopicCreate(w http.ResponseWriter, r *http.Request)

func TopicDisconnection

func TopicDisconnection(w http.ResponseWriter, r *http.Request)

强制指定topic下全部设备断开接收推送

func TopicLog

func TopicLog(w http.ResponseWriter, r *http.Request)

获取topic记录

func Ws

func Ws(w http.ResponseWriter, r *http.Request)

Types

type PublishParam

type PublishParam struct {
	TopicName string `json:"topic_name"`
	Data      string `json:"data"` // 发布的内容
}

发布

type SubscriptionParam

type SubscriptionParam struct {
	TopicName  string   `json:"topic_name"`
	DeviceList []string `json:"device_list"` // 发布的内容
}

type TopicCreateParam

type TopicCreateParam struct {
	Name string `json:"topic_name"`
}

创建 Topic

Jump to

Keyboard shortcuts

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