cloud

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package cloud 智汀云模块,提供与智汀云对接的功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBrandsMap added in v1.5.0

func GetBrandsMap() (brandsMap map[string]Brand, err error)

func SaveBrandLogos added in v1.5.0

func SaveBrandLogos()

SaveBrandLogos TODO 保存所有品牌logo

func StartDataTunnel

func StartDataTunnel(ctx context.Context)

func StartTunnel

func StartTunnel(ctx context.Context)

Types

type Brand added in v1.5.0

type Brand struct {
	LogoURL      string `json:"logo_url"`
	Name         string `json:"name"`
	PluginAmount int    `json:"plugin_amount"` // 插件数量
}

func GetBrands added in v1.5.0

func GetBrands() (brands []Brand, err error)

type BrandInfo added in v1.5.0

type BrandInfo struct {
	Brand
	Plugins []Plugin `json:"plugins"`
}

func GetBrandInfo added in v1.5.0

func GetBrandInfo(brandName string) (brand BrandInfo, err error)

type ControlStreamClient

type ControlStreamClient struct {
	SaID string
	Key  string

	LogLevel string
	// contains filtered or unexported fields
}

func (*ControlStreamClient) HandleStream

type Device added in v1.5.0

type Device struct {
	Model string     `json:"model" `
	Name  string     `json:"name"`
	Type  DeviceType `json:"type"` // 设备类型

	Control      string `json:"control"`      // 设备控制页面相对路径
	Provisioning string `json:"provisioning"` // 设备置网页面相对路径
}

type DeviceSubType added in v1.5.0

type DeviceSubType string

type DeviceType added in v1.5.0

type DeviceType string
const (
	TypeLight          DeviceType = "light"           // 灯
	TypeSwitch         DeviceType = "switch"          // 开关
	TypeOutlet         DeviceType = "outlet"          // 插座
	TypeRoutingGateway DeviceType = "routing_gateway" // 路由网关
	TypeSecurity       DeviceType = "security"        // 安防
)

type Plugin added in v1.5.0

type Plugin struct {
	ID      int    `json:"id"`
	Domain  string `json:"domain"`
	Name    string `json:"name"`
	Image   string `json:"image"`
	Version string `json:"version"`
	Brand   string `json:"brand"`
	Intro   string `json:"intro"`
}

func GetPlugin added in v1.5.0

func GetPlugin(domain string) (plugin Plugin, err error)

func GetPlugins added in v1.5.0

func GetPlugins() (plugins []Plugin, err error)

Jump to

Keyboard shortcuts

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