Documentation ¶
Index ¶
Constants ¶
View Source
const (
BotName = "gobot_pir"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Placement string `json:"placement,omitempty"` MetricsAddr string `json:"metrics_addr,omitempty"` IntervalSecs int `json:"interval_s,omitempty"` StatIntervals []int `json:"stat_intervals,omitempty"` LogSensor bool `json:"log_sensor,omitempty"` MessageOn string `json:"message_on"` MessageOff string `json:"message_off"` MqttConfig SensorConfig }
func ConfigFromEnv ¶
func ConfigFromEnv() Config
func DefaultConfig ¶
func DefaultConfig() Config
func ReadJsonConfig ¶
func (*Config) FormatTopic ¶
func (conf *Config) FormatTopic()
func (*Config) GetStatIntervalMax ¶ added in v1.5.0
func (*Config) GetStatIntervalMin ¶ added in v1.5.0
type MqttConfig ¶
type MqttConfig struct { Host string `json:"mqtt_host,omitempty"` Topic string `json:"mqtt_topic,omitempty"` ClientKeyFile string `json:"mqtt_ssl_key_file,omitempty"` ClientCertFile string `json:"mqtt_ssl_cert_file,omitempty"` ServerCaFile string `json:"mqtt_ssl_ca_file,omitempty"` StatsTopic string `json:"mqtt_stats_topic,omitempty"` }
func (*MqttConfig) Print ¶ added in v1.6.0
func (conf *MqttConfig) Print()
func (*MqttConfig) UsesSslCerts ¶ added in v1.6.0
func (conf *MqttConfig) UsesSslCerts() bool
func (*MqttConfig) Validate ¶ added in v1.6.0
func (conf *MqttConfig) Validate() error
type SensorConfig ¶
type SensorConfig struct { GpioPin string `json:"gpio_pin,omitempty"` GpioPollingIntervalMs int `json:"gpio_polling_interval_ms,omitempty"` }
func (*SensorConfig) ConfigFromEnv ¶
func (conf *SensorConfig) ConfigFromEnv()
func (*SensorConfig) Print ¶
func (conf *SensorConfig) Print()
func (*SensorConfig) Validate ¶
func (conf *SensorConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.