config

package
v0.0.0-...-fc28734 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger      log.Config        `yaml:"logger" json:"logger"`
	Server      Server            `yaml:"server" json:"server"`
	Uplink      UplinkConfig      `yaml:"uplink" json:"uplink"`
	MqttConfig  mqtt.ClientConfig `yaml:"mqttConfig" json:"mqttConfig"`
	ConvertFunc []string          `yaml:"convertFunc" json:"convertFunc"`
	Plugin      struct {
		Drivers []plugin.DriverConfig `yaml:"drivers" json:"drivers" default:"[]"`
	} `yaml:"plugin" json:"plugin"`
	MessageCacheConfig  MessageCacheConfig `yaml:"messageCacheConfig" json:"messageCacheConfig"`
	SendMessageInterval time.Duration      `yaml:"sendMessageInterval" json:"sendMessageInterval" default:"3s"`
	MaxInterval         time.Duration      `yaml:"maxInterval" json:"maxInterval" default:"60s"`
	MinInterval         time.Duration      `yaml:"minInterval" json:"minInterval" default:"2s"`
}

Config gateway main config

type DeviceProperty

type DeviceProperty struct {
	PropName string      `yaml:"propName" json:"propName"`
	PropVal  interface{} `yaml:"propVal" json:"propVal"`
}

type Entry

type Entry struct {
	Entry string `yaml:"entry" json:"entry" validate:"nonzero"`
}

type MessageCacheConfig

type MessageCacheConfig struct {
	FilePath      string        `yaml:"filePath" json:"filePath" default:"/var/lib/baetyl/store"`
	Enable        bool          `yaml:"enable" json:"enable"`
	CacheDuration time.Duration `yaml:"cacheDuration" json:"cacheDuration" default:"24h"`
	// interval between loop executions
	Interval time.Duration `yaml:"interval" json:"interval" default:"3s"`
	// support disk memory
	CacheType string `yaml:"cacheType" json:"cacheType" default:"disk"`
	//clear history cache data
	Clear        bool   `yaml:"clear" json:"clear"`
	MaxMemoryUse string `yaml:"maxMemoryUse" json:"maxMemoryUse" default:"100MB"`
	FailChanSize int    `yaml:"failChanSize" json:"failChanSize" default:"100"`
}

type NorthHTTPConfig

type NorthHTTPConfig struct {
	http.ClientConfig `yaml:",inline" json:",inline"`
	Path              string            `yaml:"path" json:"path"`
	Method            string            `yaml:"method" json:"method"`
	Headers           map[string]string `yaml:"headers" json:"headers"`
	RetryTimes        int               `yaml:"retryTimes" json:"retryTimes" default:"1"`
	ID                string            `yaml:"id" json:"id"`
}

type NorthMQTTConfig

type NorthMQTTConfig struct {
	ID                string `yaml:"id" json:"id"`
	mqtt.ClientConfig `yaml:",inline" json:",inline"`
	RetryTimes        int `yaml:"retryTimes" json:"retryTimes" default:"1"`
}

type NorthWsConfig

type NorthWsConfig struct {
	ID                     string `yaml:"id" json:"id"`
	websocket.ClientConfig `yaml:",inline" json:",inline"`
	RetryTimes             int `yaml:"retryTimes" json:"retryTimes" default:"1"`
}

type Server

type Server struct {
	Port         string            `yaml:"port" json:"port"`
	ReadTimeout  time.Duration     `yaml:"readTimeout" json:"readTimeout" default:"30s"`
	WriteTimeout time.Duration     `yaml:"writeTimeout" json:"writeTimeout" default:"30s"`
	ShutdownTime time.Duration     `yaml:"shutdownTime" json:"shutdownTime" default:"3s"`
	Certificate  utils.Certificate `yaml:",inline" json:",inline"`
}

Server server config

type UplinkConfig

type UplinkConfig struct {
	HTTPConfig      []NorthHTTPConfig `yaml:"httpConfig" json:"httpConfig"`
	MQTTConfig      []NorthMQTTConfig `yaml:"mqttConfig" json:"mqttConfig"`
	WebsocketConfig []NorthWsConfig   `yaml:"wsConfig" json:"wsConfig"`
}

Jump to

Keyboard shortcuts

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