options

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPOptions added in v1.1.1

type AMQPOptions struct {
	Host            string `json:"host"`            // 服务终端节点
	Port            int    `json:"port"`            // 服务终端端口
	InstanceID      string `json:"instanceId"`      // IoT 服务实例标识
	ClientID        string `json:"clientId"`        // 客户端标识
	ConsumerGroupID string `json:"consumerGroupId"` // 消费组标识
	AccessKeyID     string `json:"accessKeyId"`     // 密钥 ID
	AccessKeySecret string `json:"accessKeySecret"` // 密钥
}

AMQPOptions AMQP 服务连接设置

type DeviceInfo

type DeviceInfo struct {
	IotInstanceID string `json:"iotInstanceId"` // 服务实例标识
	ProductKey    string `json:"productKey"`    // 产品标识
	DeviceName    string `json:"deviceName"`    // 设备标识
}

DeviceInfo IoT 设备信息

func (*DeviceInfo) GenerateRequest

func (deviceInfo *DeviceInfo) GenerateRequest(serviceId string, params interface{}) (req *iot.InvokeThingServiceRequest, err error)

GenerateRequest 生成服务的调用请求(异步)

func (*DeviceInfo) GenerateSubscribeTopicRequest added in v1.3.0

func (deviceInfo *DeviceInfo) GenerateSubscribeTopicRequest(topic []string) (req *iot.SubscribeTopicRequest, err error)

func (*DeviceInfo) GenerateSyncRequest added in v1.3.0

func (deviceInfo *DeviceInfo) GenerateSyncRequest(payload *ServiceSyncRequestPayload) (req *iot.RRpcRequest, err error)

GenerateSyncRequest 生成服务同步调用请求

type ServiceInvokerOptions

type ServiceInvokerOptions struct {
	RegionID        string // IoT 平台服务地域标识,详情参考 https://help.aliyun.com/document_detail/40654.htm
	AccessKeyID     string // IoT 平台服务访问密钥标识
	AccessKeySecret string // IoT 平台服务访问密钥
}

ServiceInvokerOptions 服务调用者设置

type ServiceSyncRequestPayload added in v1.3.0

type ServiceSyncRequestPayload struct {
	ID      string      `json:"id"`      // 调用标识
	Version string      `json:"version"` // 协议版本,固定为 "1.0"
	Params  interface{} `json:"params"`  // 输入参数
	Method  string      `json:"method"`  // 服务标识,格式如:thing.service.<serviceId>
}

ServiceSyncRequestPayload 服务调用载荷

func NewServiceSyncRequestPayload added in v1.3.0

func NewServiceSyncRequestPayload(method string, params interface{}) *ServiceSyncRequestPayload

NewServiceSyncRequestPayload 创建新的服务同步调用载荷

func NewServiceSyncRequestPayloadByIdentifier added in v1.3.0

func NewServiceSyncRequestPayloadByIdentifier(serviceId string, params interface{}) *ServiceSyncRequestPayload

NewServiceSyncRequestPayloadByIdentifier 使用服务标识创建服务同步调用载荷

func (*ServiceSyncRequestPayload) Serialize added in v1.3.0

func (rp *ServiceSyncRequestPayload) Serialize() ([]byte, error)

Serialize 序列化服务同步调用载荷

func (*ServiceSyncRequestPayload) SerializeBase64 added in v1.3.0

func (rp *ServiceSyncRequestPayload) SerializeBase64() (string, error)

SerializeBase64 将同步调用载荷序列化为 Base64 字符串

type ServiceSyncResponse added in v1.3.0

type ServiceSyncResponse struct {
	ID   string      `json:"id"`             // 响应标识
	Code int         `json:"code"`           // 响应状态标识,详情参考 https://help.aliyun.com/document_detail/89309.htm
	Data interface{} `json:"data,omitempty"` // 响应参数
}

ServiceSyncResponse 服务同步调用响应

func NewServiceResponseByBase64

func NewServiceResponseByBase64(base64Payload string) (*ServiceSyncResponse, error)

NewServiceResponseByBase64 通过 Base64 字符串创建服务响应对象

Jump to

Keyboard shortcuts

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