config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TypeValue assign string to PvType
	TypeValue = map[string]modbuspv.PvType{
		"u16":  modbuspv.PvU16,
		"u32":  modbuspv.PvU32,
		"u64":  modbuspv.PvU64,
		"i16":  modbuspv.PvI16,
		"i32":  modbuspv.PvI32,
		"i64":  modbuspv.PvI64,
		"bool": modbuspv.PvBool,
		"f32":  modbuspv.PvF32,
		"f64":  modbuspv.PvF64,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Name   string       `json:"name" yaml:"name"`
	Modbus modbusConfig `json:"modbus" yaml:"modbus"`
	Nats   natsConfig   `json:"nats" yaml:"nats"`
	Pvs    []pvConfig   `json:"pvs" yaml:"pvs"`
	Prom   promConfig   `json:"prom" yaml:"prom"`
}

Config contains all configuration in this program

func ReadConfigAndValidate

func ReadConfigAndValidate(filename string) (Config, error)

ReadConfigAndValidate reads the config from file, validates and returns it

func (Config) Validate

func (c Config) Validate() error

Validate validates the correctness of config in this program

Jump to

Keyboard shortcuts

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