comm

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBTdEngine = "TdEngine"
	DBInfluxdb = "Influxdb"

	// td 产品表前缀
	TdProductPrefix = "product_"
	// td 设备表前缀
	TdDevicePrefix = "device_"
	// td 日志表前缀
	TdLogPrefix = "log_"
	// td 属性前缀
	TdPropertyPrefix = "p_"
	// td tag前缀
	TdTagPrefix = "t_"
)

Variables

This section is empty.

Functions

func ChangeTime

func ChangeTime(v *g.Var) (rs *g.Var)

ChangeTime 连接时区处理

func DeviceLogTable

func DeviceLogTable(key string) string

DeviceLogTable 获取TSD设备日志表名

func DeviceTableName

func DeviceTableName(key string) string

DeviceTableName 获取TSD设备表名

func GetDeviceField

func GetDeviceField(data iotModel.ReportPropertyData) (keys, field []string)

GetDeviceField 获取设备数据key原始顺序列表与重构后的字段

func GetDeviceFieldAndValue

func GetDeviceFieldAndValue(data iotModel.ReportPropertyData) (field, value []string)

GetDeviceFieldAndValue 同时获取设备数据字段与值

func GetDeviceValue

func GetDeviceValue(field []string, data iotModel.ReportPropertyData) []string

GetDeviceValue 获取设备数据值

func ProductTableName

func ProductTableName(key string) string

ProductTableName 获取TSD产品表名

func TsdColumnName

func TsdColumnName(key string) string

TsdColumnName 属性字段加前缀

func TsdTagName

func TsdTagName(key string) string

TsdTagName tag字段加前缀

Types

type Option

type Option struct {
	Host         string
	Port         int
	Link         string
	Org          string
	Token        string
	Username     string
	Password     string
	Database     string
	DriverName   string // 驱动名称
	MaxIdleConns int    // 最大空闲连接数
	MaxOpenConns int    // 最大连接数
}

Option 包含数据库连接的配置选项

Jump to

Keyboard shortcuts

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