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 { Location string `json:"location,omitempty"` MetricConfig string `json:"metrics_addr,omitempty"` IntervalSecs int `json:"interval_s,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()
type MqttConfig ¶
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.