client

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 保活时间
	KEEPALIVE = 10
	// S3 Endpoint
	S3ENDPOINT = "https://ossnucloud.nuctech.com"
)

定义常量

Variables

This section is empty.

Functions

func NewIotClient

func NewIotClient(DeviceReg m.DeviceRegistrationReq, DeviceStg m.DeviceStorage, MqttInfo m.MqttBrokerInfo) *nucIotClient

@title NewIotClient @description 初始化nucIotClient @param DeviceReg m.DeviceRegistrationReq 设备注册信息 @param DeviceStg m.DeviceStorage 存储相关信息 @param MqttInfo m.MqttBrokerInfo Mqtt相关信息 @return NucIotClient NucIotClient实例

Types

type NucIotClient

type NucIotClient interface {
	// 配置初始化
	Configure()
	// 设备注册
	SendRegistration() int
	// 设备运行信息
	SendDeviceData(deviceId string, dataItems []m.DataItem)
	// 设备状态
	SendDeviceStat(deviceId string, status int)
	// 文件信息
	SendFileInfo(deviceId, fileName, filePath string, fileSize int, fileType m.EnumFileType, userData string)
	// 上传文件到S3
	UploadFile2S3(deviceId, filePath string, fileType m.EnumFileType)
	// 注册事件
	RegisterEvent(name m.EnumEvent, callback func(...interface{}))
}

NucIotClient IoT客户端接口

type S3Client

type S3Client struct {
	Client *s3.S3
}

S3客户端

Jump to

Keyboard shortcuts

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