config

package
v0.0.0-...-6752d0c Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetMetric

func GetMetric() []string

func LoadParams

func LoadParams()

func SaveParamsYaml

func SaveParamsYaml(s []byte)

Types

type Attribute

type Attribute struct {
	Namespace string `yaml:"namespace"` // 名字空间,sn_xx,后缀
	Name      string
	Value     string // 计算值

	// 脚本获取
	Script string

	// 协议相关
	ChannelRefName string `yaml:"channelRefName"`
	SlaveId        int    `yaml:"slaveId"`
	Address        int
	DataType       string `yaml:"dataType"`
}

type Channel

type Channel struct {
	Name     string
	Network  string // rtu tcp
	Endpoint string
	Protocol string // modbus geNi
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Provider string // 暂时没用,准备兼容各个平台 [echo,aliyun,aws,azure]
	Server   struct {
		Host string
		Tls  bool
	}
	Device struct {
		ProductKey   string
		DeviceName   string
		DeviceSecret string
	}
}

func GetConfig

func GetConfig() *Config

type DataGroup

type DataGroup struct {
	Name   string
	Client modbus.Client
}

type Params

type Params struct {
	Channels   []Channel
	Attributes []Attribute
	DataGroups map[string]*DataGroup
}

func GetParams

func GetParams() *Params

func (*Params) Init

func (p *Params) Init(s string)

func (*Params) LoadData

func (p *Params) LoadData(sn string) map[string]map[string]interface{}

Jump to

Keyboard shortcuts

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