configs

package
v0.0.0-...-48477cc Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name string `yaml:"name"`
}

type Config

type Config struct {
	App         App         `yaml:"app"`
	Debug       Debug       `yaml:"debug"`
	OpcuaConfig OpcuaConfig `yaml:"opcua_config"`
	MqttConfig  MqttConfig  `yaml:"mqtt_config"`
	ItemsFile   ItemsFile   `yaml:"items_file"`
	Items       []Item
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type Debug

type Debug struct {
	Level string `yaml:"level"`
}

type Item

type Item struct {
	Name     string `validate:"required"`
	Item     string `validate:"required"`
	Type     string `validate:"required"`
	ReadOnly bool   `validate:"required"`
	Topic    string `validate:"required"`
	Retain   bool   `validate:"required"`
	QoS      int8   `validate:"required,gte=0,lt=3"`
}

type ItemsFile

type ItemsFile struct {
	Name string `yaml:"name"`
}

type MqttConfig

type MqttConfig struct {
	Broker   string `yaml:"broker"`
	UserName string `yaml:"user_name"`
	Password string `yaml:"password"`
}

type OpcuaConfig

type OpcuaConfig struct {
	Endpoint        string `yaml:"endpoint"`
	SecurityPolicy  string `yaml:"security_policy"`
	SecurityMode    string `yaml:"security_mode"`
	RequestTimeout  string `yaml:"request_timeout"`
	PrivateKey      string `yaml:"private_key"`
	Certificate     string `yaml:"certificate"`
	UserName        string `yaml:"user_name"`
	UserPassword    string `yaml:"user_password"`
	AuthMethod      string `yaml:"auth_method"`
	DialTimeout     string `yaml:"dial_timeout"`
	ReadingInterval string `yaml:"reading_interval"`
}

Jump to

Keyboard shortcuts

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