config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(c Config) error

Save - store config in a file

Types

type AgentConf

type AgentConf struct {
	Server    ServerConf `toml:"server"`
	Terminal  Terminal   `toml:"terminal"`
	Heartbeat Heartbeat  `toml:"heartbeat"`
	Channels  ChanConf   `toml:"channels"`
	Edgex     EdgexConf  `toml:"edgex"`
	Log       LogConf    `toml:"log"`
	MQTT      MQTTConf   `toml:"mqtt"`
}

Config struct of Mainflux Agent

type ChanConf

type ChanConf struct {
	Control string `toml:"control"`
	Data    string `toml:"data"`
}

type Config

type Config struct {
	Agent AgentConf
	File  string
}

func New

func New(sc ServerConf, cc ChanConf, ec EdgexConf, lc LogConf, mc MQTTConf, hc Heartbeat, tc Terminal, file string) Config

func Read

func Read(file string) (Config, error)

Read - retrieve config from a file

type EdgexConf

type EdgexConf struct {
	URL string `toml:"url"`
}

type Heartbeat added in v0.11.0

type Heartbeat struct {
	Interval time.Duration `toml:"interval"`
}

type LogConf

type LogConf struct {
	Level string `toml:"level"`
}

type MQTTConf

type MQTTConf struct {
	URL         string          `json:"url" toml:"url"`
	Username    string          `json:"username" toml:"username" mapstructure:"username"`
	Password    string          `json:"password" toml:"password" mapstructure:"password"`
	MTLS        bool            `json:"mtls" toml:"mtls" mapstructure:"mtls"`
	SkipTLSVer  bool            `json:"skip_tls_ver" toml:"skip_tls_ver" mapstructure:"skip_tls_ver"`
	Retain      bool            `json:"retain" toml:"retain" mapstructure:"retain"`
	QoS         byte            `json:"qos" toml:"qos" mapstructure:"qos"`
	CAPath      string          `json:"ca_path" toml:"ca_path" mapstructure:"ca_path"`
	CertPath    string          `json:"cert_path" toml:"cert_path" mapstructure:"cert_path"`
	PrivKeyPath string          `json:"priv_key_path" toml:"priv_key_path" mapstructure:"priv_key_path"`
	CA          []byte          `json:"-" toml:"-"`
	Cert        tls.Certificate `json:"-" toml:"-"`
}

type ServerConf

type ServerConf struct {
	Port    string `toml:"port"`
	NatsURL string `toml:"nats_url"`
}

type Terminal added in v0.11.0

type Terminal struct {
	SessionTimeout time.Duration `toml:"session_timeout"`
}

Jump to

Keyboard shortcuts

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