common

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Resource   = "Resource"
	MQTTBroker = "MQTTBroker"
)
View Source
const (
	GRPCTimeout          = 5 * time.Second
	GRPCHttpTimeout      = 10 * time.Second
	DefaultConfiguration = "/etc/driver/res/configuration.toml"
)
View Source
const (
	HTTP_API_EG_SYNCDATA_RESULT                   = "tuya.industry.base.eg.syncdata.result.post"
	HTTP_API_EDGE_GATEWAY_SYNCDATA_RESULT         = "tuya.industry.base.edge.gateway.syncdata.type.result.post"
	HTTP_API_EDGE_UPLOAD_TOKEN                    = "tuya.industry.base.edge.file.upload.token"
	HTTP_API_EDGE_DEVICE_QUERY_ALL                = "tuya.industry.base.edge.device.query.all"
	HTTP_API_EG_DEVICE_CID_QUERY                  = "tuya.industry.base.eg.device.cid.query"
	HTTP_API_EDGE_IPC_MODIFY_SKILL                = "tuya.industry.base.edge.ipc.modify.skill"
	HTTP_API_EDGE_FILE_UPLOAD_ALG                 = "tuya.industry.base.edge.file.upload.alg"
	HTTP_API_DEVICE_IPC_TY_SUB_STORAGE_SECRET_GET = "tuya.device.ipc.ty.sub.storage.secret.get "
	HTTP_API_EDGE_IPC_QUERY_DETAIL                = "tuya.industry.base.edge.ipc.query.detail"
	HTTP_DEVICE_IPC_STORAGE_SECRET_GET            = "tuya.device.ipc.storage.secret.get"
	HTTP_DEVICE_SKILL_UPDATE                      = "tuya.device.skill.update"
	HTTP_DEVICE_TY_SUB_STOR_CONFIG_GET            = "tuya.device.ty.sub.stor.config.get"
)
View Source
const (
	DeviceFromUnknown = iota
	DeviceFromWeb
	DeviceFromDriver
	DeviceActive
)
View Source
const (
	ATOP_ILLEGAL_ERR  = "ILLEGAL_ACCESS_API"
	ATOP_UNKNOW_ERR   = "REMOTE_API_RUN_UNKNOW_FAILED"
	ATOP_REPEATED_ERR = "REPEATED_REQUEST"
	ATOP_LIMIT_ERR    = "API_QPS_LIMIT_OR_DEGRADE"
	ATOP_INTERNAL_ERR = "INTERNAL_ERROR"
)
View Source
const ContentMaxLen = 0xFF

Variables

View Source
var EmptyPb = new(emptypb.Empty)

Functions

func Path

func Path(rel string) string

Types

type AtopResp

type AtopResp struct {
	T         int64  `json:"t"`
	Success   bool   `json:"success"`
	ErrorCode string `json:"errorCode"`
	ErrorMsg  string `json:"errorMsg"`
}

type IPCSkillSet

type IPCSkillSet struct {
	CloudGW    int32  `json:"cloudGW"` //支持推流网关
	WebRtc     int32  `json:"webrtc"`
	P2P        int32  `json:"p2p"`
	SdkVersion string `json:"sdk_version"`
}

/////////////////////////////////////////////////////////////////////////////////////////

type ImageFileInfo

type ImageFileInfo struct {
	TmpFileId string `json:"tmp_file_id"`
}

type MsgAckChan

type MsgAckChan struct {
	Mu       sync.Mutex
	Id       string
	IsClosed bool
	DataChan chan interface{}
}

func (*MsgAckChan) TryCloseChan

func (mac *MsgAckChan) TryCloseChan()

func (*MsgAckChan) TrySendDataAndCloseChan

func (mac *MsgAckChan) TrySendDataAndCloseChan(data interface{}) bool

type OssStruct

type OssStruct struct {
	Result  []ResultNode `json:"result"`
	Success bool         `json:"success"`
	E       bool         `json:"e"`
	T       int64        `json:"t"`
}

type ResultNode

type ResultNode struct {
	PathConfig struct {
		Log    string `json:"log"`
		Detect string `json:"detect"`
	} `json:"pathConfig"` // 网关devID
	AK         string `json:"ak"`
	SK         string `json:"sk"`
	Token      string `json:"token"`
	Bucket     string `json:"bucket"`
	LifeCycle  int64  `json:"lifeCycle"`
	Endpoint   string `json:"endpoint"`
	Provider   string `json:"provider"`
	Region     string `json:"region"`
	Expiration string `json:"expiration"`
	Id         string `json:"id"`
}

func (ResultNode) String

func (rn ResultNode) String() string

type UploadImageResp

type UploadImageResp struct {
	Success bool          `json:"success"`
	Msg     string        `json:"msg,omitempty"`
	T       int64         `json:"t"`
	Result  ImageFileInfo `json:"result"`
}

UploadImageResp 上传图片对应的消息回复

type UploadResopnse

type UploadResopnse struct {
	Bucket     string `json:"bucket"`
	ObjectKey  string `json:"objectKey"`
	SecretKey  string `json:"secretKey"`
	ExpireTime int64  `json:"expireTime"`
}

type UploadTokenInfo

type UploadTokenInfo struct {
	UploadUrl string `json:"uploadUrl"`
	Token     string `json:"token"`
}

type UploadTokenResp

type UploadTokenResp struct {
	Result  UploadTokenInfo `json:"result"`
	T       int64           `json:"t"`
	Success bool            `json:"success"`
	Status  string          `json:"status"`
}

UploadTokenResp 对应的消息回复

Jump to

Keyboard shortcuts

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